mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-02 10:52:27 +00:00
Fix: Cancel NIP-46 handshake on login modal cancellation
Implemented a mechanism to cancel the pending NIP-46 handshake when the user clicks 'Cancel' in the login modal. - Added `pendingHandshakeCancel` callback to `NostrClient` to reject the handshake promise. - Updated `LoginModalController` to invoke `disconnectRemoteSigner` on cancellation. - Prevented `onLoginError` callback from triggering when the error code is `login-cancelled`. Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
1 parent
63e5c9f415
commit
13ab4e790d
2 files changed
+31
No files matched your search
@@ -1487,6 +1487,7 @@ export default class LoginModalController {
|
||||
this.rejectPendingTask(this.createCancellationError(), {
|
||||
type: "add-profile",
|
||||
});
|
||||
this.handleProviderDisconnect("nip46");
|
||||
cleanup();
|
||||
} else {
|
||||
finish(null, { keepMounted: false });
|
||||
@@ -2392,6 +2393,13 @@ export default class LoginModalController {
|
||||
return;
|
||||
}
|
||||
|
||||
if (
|
||||
rejectionError.code === "login-cancelled" ||
|
||||
rejectionError.code === "user-cancelled"
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
await safeInvokeAsync(this.callbacks.onLoginError, {
|
||||
provider: entry.provider.source || entry.provider,
|
||||
error: rejectionError,
|
||||
|
||||
Reference in new issue
Block a user