From 250276d70ab25f60a16c85f74a672d1d4b59f8e1 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 26 Aug 2026 09:25:26 -0700 Subject: A doormat note is read once: the profile deep link is consumed by the first wallet to see it, so logging out and starting fresh in the same tab lands on the new home screen, not the last visitor's profile Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_019eA8JRq9Wr7z2fRQk99HLi --- src/features/messages.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/features/messages.js b/src/features/messages.js index f563435..5400119 100644 --- a/src/features/messages.js +++ b/src/features/messages.js @@ -613,7 +613,10 @@ export function messagesFeature(ctx) { // app — the server tries them first — and gift/invite links carry their own // multi-segment paths, which this single-segment shape can't match. The // path is consumed immediately so a reload lands on the wallet as usual. - const urlProfile = (() => { + // `let`, not const: consumed on first init. Features re-init without a page + // load (logout-and-forget → new wallet), and the link belongs to the visit + // that carried it, not to every wallet born in the same tab. + let urlProfile = (() => { if (typeof location === 'undefined' || urlInvite) return null; const m = location.pathname.match(/^\/([A-Za-z0-9._-]{1,64})\/?$/); return m ? m[1] : null; @@ -2394,12 +2397,14 @@ export function messagesFeature(ctx) { setTimeout(() => { ui.chatOpen = true; ui.msgView = 'home'; render(); }, 0); } if (urlProfile) { + const target = urlProfile; + urlProfile = null; (async () => { - let pk = parseNostrPubkey(urlProfile); - if (!pk && /^[a-z0-9._-]{1,30}$/i.test(urlProfile)) { + let pk = parseNostrPubkey(target); + if (!pk && /^[a-z0-9._-]{1,30}$/i.test(target)) { // same registrar + domain rule the names feature uses const domain = getNetwork() === 'mutinynet' ? 'staging.coinos.io' : 'coinos.io'; - const name = urlProfile.toLowerCase(); + const name = target.toLowerCase(); try { const j = await fetch(`https://names.coinos.io/.well-known/nostr.json?name=${encodeURIComponent(name)}&domain=${domain}`) .then((r) => r.json()); -- cgit v1.2.3