aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-08-26 09:25:26 -0700
committerAdam Soltys <[email protected]>2026-08-26 09:25:26 -0700
commit250276d70ab25f60a16c85f74a672d1d4b59f8e1 (patch)
tree49af8109bc12e6d2f3cc0c5cb084e810ba2c2748 /src
parent5b92c9384074e0d94c784193be00f03a08bb9599 (diff)
downloadcoinosv3-250276d70ab25f60a16c85f74a672d1d4b59f8e1.tar.gz
coinosv3-250276d70ab25f60a16c85f74a672d1d4b59f8e1.zip
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 <[email protected]> Claude-Session: https://claude.ai/code/session_019eA8JRq9Wr7z2fRQk99HLi
Diffstat (limited to 'src')
-rw-r--r--src/features/messages.js13
1 files changed, 9 insertions, 4 deletions
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());