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

@ -45,7 +45,7 @@ export function NoteContextMenu({ ev, ...props }: NosteContextMenuProps) {
}
async function share() {
const link = NostrLink.fromEvent(ev, CONFIG.eventLinkPrefix).encode();
const link = NostrLink.fromEvent(ev).encode(CONFIG.eventLinkPrefix);
const url = `${window.location.protocol}//${window.location.host}/${link}`;
if ("share" in window.navigator) {
await window.navigator.share({
@ -81,7 +81,7 @@ export function NoteContextMenu({ ev, ...props }: NosteContextMenuProps) {
}
async function copyId() {
const link = NostrLink.fromEvent(ev).encode();
const link = NostrLink.fromEvent(ev).encode(CONFIG.eventLinkPrefix);
await navigator.clipboard.writeText(link);
}