fix: service worker build
This commit is contained in:
parent
d06a914e01
commit
7b29290420
@ -3,10 +3,9 @@ declare const self: ServiceWorkerGlobalScope & {
|
|||||||
__WB_MANIFEST: (string | PrecacheEntry)[];
|
__WB_MANIFEST: (string | PrecacheEntry)[];
|
||||||
};
|
};
|
||||||
|
|
||||||
import { NostrLink, NostrPrefix, tryParseNostrLink } from "@snort/system";
|
import { NostrLink, NostrPrefix, TLVEntryType, encodeTLVEntries, tryParseNostrLink } from "@snort/system";
|
||||||
import { formatShort } from "Number";
|
import { formatShort } from "Number";
|
||||||
import { defaultAvatar, hexToBech32 } from "SnortUtils";
|
import { defaultAvatar, hexToBech32 } from "SnortUtils";
|
||||||
import { Nip4ChatSystem } from "chat/nip4";
|
|
||||||
import { clientsClaim } from "workbox-core";
|
import { clientsClaim } from "workbox-core";
|
||||||
import { PrecacheEntry, precacheAndRoute } from "workbox-precaching";
|
import { PrecacheEntry, precacheAndRoute } from "workbox-precaching";
|
||||||
|
|
||||||
@ -70,7 +69,11 @@ self.addEventListener("notificationclick", event => {
|
|||||||
}
|
}
|
||||||
} else if (ev.type == PushType.DirectMessage) {
|
} else if (ev.type == PushType.DirectMessage) {
|
||||||
const reaction = ev.data as CompactReaction;
|
const reaction = ev.data as CompactReaction;
|
||||||
return `/chat/${Nip4ChatSystem.makeChatId(reaction.author.pubkey)}`;
|
return `/chat/${encodeTLVEntries("chat4" as NostrPrefix, {
|
||||||
|
type: TLVEntryType.Author,
|
||||||
|
value: reaction.author.pubkey,
|
||||||
|
length: 32,
|
||||||
|
})}`;
|
||||||
}
|
}
|
||||||
return `/${new NostrLink(NostrPrefix.Note, id).encode()}`;
|
return `/${new NostrLink(NostrPrefix.Note, id).encode()}`;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user