diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/features/messages.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/features/messages.js b/src/features/messages.js index 35f4712..0a14b9c 100644 --- a/src/features/messages.js +++ b/src/features/messages.js @@ -8225,7 +8225,7 @@ export function messagesFeature(ctx) { } else if (/^(nostr:|@?)(npub|nprofile)1/i.test(part)) { const bare = part.replace(/^(nostr:|@)/i, ''); const ref = parseNostrRef(bare); - if (ref && ref.type === 'pubkey') out.push(h('a', { href: '#', onClick: (e) => { e.preventDefault(); openProfile(ref.pk); } }, '@' + displayName(ref.pk))); + if (ref && ref.type === 'pubkey') out.push(h('a', { href: '#', onClick: (e) => { e.preventDefault(); e.stopPropagation(); openProfile(ref.pk); } }, '@' + displayName(ref.pk))); else out.push(h('span', { class: 'faint' }, bare.slice(0, 12) + '…')); } else if (/^nostr:(note|nevent)1/i.test(part)) { const ref = parseNostrRef(part.slice(6)); @@ -9623,7 +9623,9 @@ export function messagesFeature(ctx) { + (focus ? ';background:var(--accent-soft,rgba(128,128,128,.08));border-radius:' + (joined ? '8px 8px 0 0' : '8px') + ';padding-left:8px;padding-right:8px;margin:0 -8px' : ''), // closest('button') guard: on touch, a ⚡ tap must never double as a // row tap even if propagation quirks let the click reach us - onClick: openable ? (e) => { if (e.target && e.target.closest && e.target.closest('button')) return; openNoteThread(ev); } : undefined, + // nor a link in it: a mention opens the person, a URL its page — the + // thread opening underneath as well buried the profile under the post + onClick: openable ? (e) => { if (e.target && e.target.closest && e.target.closest('button, a')) return; openNoteThread(ev); } : undefined, }, // the avatar is its own tap-target (profile), even inside an openable // row — its handler stops propagation, so the row still opens the thread |
