1
0
forked from Kieran/snort

chore: cleanup

This commit is contained in:
Kieran 2023-10-19 16:07:37 +01:00
parent 1a984a8075
commit 3f28c94a56
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941

View File

@ -58,18 +58,12 @@ self.addEventListener("push", async e => {
const userProfile = userEvent ? mapEventToProfile(userEvent) : undefined;
const avatarUrl = userProfile?.picture ?? defaultAvatar(ev.pubkey);
const notif = {
title: `Reply from ${getDisplayName(userProfile, ev.pubkey)}`,
await self.registration.showNotification(`Reply from ${getDisplayName(userProfile, ev.pubkey)}`, {
body: replaceMentions(ev.content, mention.profiles).substring(0, 250),
icon: avatarUrl,
timestamp: ev.created_at * 1000
};
console.debug("Sending notification", notif);
await self.registration.showNotification(notif.title, {
timestamp: ev.created_at * 1000,
tag: NostrLink.fromEvent(ev).encode(),
vibrate: [500],
...notif,
});
}
break;