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