diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/features/messages.js | 8 | ||||
| -rw-r--r-- | src/features/nostrlogin.js | 6 |
2 files changed, 11 insertions, 3 deletions
diff --git a/src/features/messages.js b/src/features/messages.js index 28e20f1..be5f785 100644 --- a/src/features/messages.js +++ b/src/features/messages.js @@ -2950,7 +2950,13 @@ export function messagesFeature(ctx) { const login = hook('nostrLoginIdentity'); return !login || !!(login.signer && !login.signer.interactive && login.signer.decryptFrom); } - const interactiveLogin = () => { const l = hook('nostrLoginIdentity'); return !!(l && l.signer && l.signer.interactive); }; + // an Amber-by-intent account, whether or not its signer has woken yet: + // a wallet whose every wrap was already logged never wakes it, and then + // never said why its messages were missing + const interactiveLogin = () => { + const l = hook('nostrLoginIdentity'); + return !!l && (l.signer ? !!l.signer.interactive : l.via === 'amber'); + }; // Wraps logged while an interactive signer stood in for the login npub // may be messages no key here ever tried. Once a signer that can decrypt // takes over (Amber reconnected over NIP-46), the heal pass re-opens diff --git a/src/features/nostrlogin.js b/src/features/nostrlogin.js index 2023931..4f1f0de 100644 --- a/src/features/nostrlogin.js +++ b/src/features/nostrlogin.js @@ -763,10 +763,12 @@ export function nostrLoginFeature(ctx) { // A just-connected signer counts immediately — the persisted link lands // only after the wallet opens, and the header avatar shouldn't show the // wallet key's face in the gap. - if (liveSigner()) return { pubkey: live.pubkey, npub: npubOf(live.pubkey), signer: live }; + // `via`: how the account came in, known before its signer wakes (an + // Amber account is one whether or not Amber has been asked anything yet) const st = load(); + if (liveSigner()) return { pubkey: live.pubkey, npub: npubOf(live.pubkey), signer: live, via: st.pubkey === live.pubkey ? reconnectViaOf(st) : viaOf(live) }; if (!st.pubkey) return null; - return { pubkey: st.pubkey, npub: npubOf(st.pubkey), signer: live }; + return { pubkey: st.pubkey, npub: npubOf(st.pubkey), signer: live, via: reconnectViaOf(st) }; }, // A page reload loses the signer. A stored passkey key or an installed // extension reattaches without prompting, which is what lets the payment |
