aboutsummaryrefslogtreecommitdiffstats
path: root/src/features/nostrlogin.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/features/nostrlogin.js')
-rw-r--r--src/features/nostrlogin.js6
1 files changed, 4 insertions, 2 deletions
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