bug: render naddr link

This commit is contained in:
Kieran 2023-04-15 00:27:19 +01:00
parent cc4cda64f4
commit 5736bad21f
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941
1 changed files with 4 additions and 4 deletions

View File

@ -9,11 +9,11 @@ export default function NostrLink({ link }: { link: string }) {
if (nav?.type === NostrPrefix.PublicKey || nav?.type === NostrPrefix.Profile) {
return <Mention pubkey={nav.id} relays={nav.relays} />;
} else if (nav?.type === NostrPrefix.Note || nav?.type === NostrPrefix.Event) {
const evLink = eventLink(nav.id, nav.relays);
} else if (nav?.type === NostrPrefix.Note || nav?.type === NostrPrefix.Event || nav?.type === NostrPrefix.Address) {
const evLink = nav.encode();
return (
<Link to={evLink} onClick={e => e.stopPropagation()} state={{ from: location.pathname }}>
#{evLink.split("/").at(-1)?.substring(0, 12)}
<Link to={`/e/${evLink}`} onClick={e => e.stopPropagation()} state={{ from: location.pathname }}>
#{evLink.substring(0, 12)}
</Link>
);
} else {