NostrLink.encode(prefix: NostrPrefix)

This commit is contained in:
Martti Malmi
2023-10-18 10:01:25 +03:00
parent 700db8f62c
commit 2e663dcb4c
17 changed files with 31 additions and 49 deletions

View File

@ -151,12 +151,12 @@ export function NoteInner(props: NoteProps) {
return;
}
const link = NostrLink.fromEvent(eTarget, CONFIG.eventLinkPrefix);
const link = NostrLink.fromEvent(eTarget);
// detect cmd key and open in new tab
if (e.metaKey) {
window.open(`/${link.encode()}`, "_blank");
window.open(`/${link.encode(CONFIG.eventLinkPrefix)}`, "_blank");
} else {
navigate(`/${link.encode()}`, {
navigate(`/${link.encode(CONFIG.eventLinkPrefix)}`, {
state: eTarget,
});
}