@konemono/nostr-login 1.7.19 → 1.7.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@konemono/nostr-login",
3
- "version": "1.7.19",
3
+ "version": "1.7.21",
4
4
  "description": "",
5
5
  "main": "./dist/index.esm.js",
6
6
  "types": "./dist/index.d.ts",
package/src/index.ts CHANGED
@@ -94,9 +94,10 @@ export class NostrLoginInitializer {
94
94
  });
95
95
 
96
96
  this.authNostrService.on('timeout', () => {
97
- console.log('nostr-login: timeout event received, calling cancelNostrConnect');
97
+ console.log('nostr-login: timeout event received');
98
98
  this.bannerManager.onCallTimeout();
99
- this.authNostrService.cancelNostrConnect();
99
+ // Don't cancel the connection on timeout - user may want to retry
100
+ // this.authNostrService.cancelNostrConnect();
100
101
  });
101
102
 
102
103
  this.modalManager.on('onAuthUrlClick', url => {
@@ -713,9 +713,12 @@ class AuthNostrService extends EventEmitter implements Signer {
713
713
  event.id = getEventHash(event);
714
714
  event.sig = await this.localSigner.sign(event);
715
715
  } else {
716
- event.pubkey = this.signer?.remotePubkey;
716
+ if (!this.signer) {
717
+ throw new Error('No signer available');
718
+ }
719
+ event.pubkey = this.signer.remotePubkey;
717
720
  event.id = getEventHash(event);
718
- event.sig = await this.signer?.sign(event);
721
+ event.sig = await this.signer.sign(event);
719
722
  }
720
723
  console.log('signed', { event });
721
724
  return event;
@@ -72,7 +72,10 @@ class BannerManager extends EventEmitter {
72
72
  this.iframeReady = undefined;
73
73
  }
74
74
  this.banner.isLoading = false;
75
- this.banner.notify = { mode: '' };
75
+ // Don't clear timeout notification, user needs to see it
76
+ if (this.banner.notify?.mode !== 'timeout') {
77
+ this.banner.notify = { mode: '' };
78
+ }
76
79
  }
77
80
  }
78
81
 
@@ -86,10 +86,8 @@ class ProcessManager extends EventEmitter {
86
86
 
87
87
  this.callCount--;
88
88
 
89
- // Only emit onCallEnd if not timed out (timeout already handled cleanup)
90
- if (!isTimedOut) {
91
- this.emit('onCallEnd');
92
- }
89
+ // Always emit onCallEnd for cleanup
90
+ this.emit('onCallEnd');
93
91
 
94
92
  // Clear the timer if it's the one we created
95
93
  if (this.callTimer === localTimer) {