mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 11:35:04 +01:00
move comment back to right place, and explain we we do it after
This commit is contained in:
parent
889ca05506
commit
b3680af342
@ -261,13 +261,16 @@ async function handlePushNotification(n) {
|
|||||||
}
|
}
|
||||||
body = n.content?.body || "New message";
|
body = n.content?.body || "New message";
|
||||||
}
|
}
|
||||||
// close any previous notifications for this room
|
|
||||||
await self.registration.showNotification(label, {
|
await self.registration.showNotification(label, {
|
||||||
body,
|
body,
|
||||||
data: {sessionId, roomId, multi},
|
data: {sessionId, roomId, multi},
|
||||||
tag: NOTIF_TAG_NEW_MESSAGE,
|
tag: NOTIF_TAG_NEW_MESSAGE,
|
||||||
badge: NOTIFICATION_BADGE_ICON
|
badge: NOTIFICATION_BADGE_ICON
|
||||||
});
|
});
|
||||||
|
// close any previous notifications for this room
|
||||||
|
// AFTER showing the new notification as on Android
|
||||||
|
// where we can only show 1 notification, this creates
|
||||||
|
// a smoother transition
|
||||||
if (notifsToClose) {
|
if (notifsToClose) {
|
||||||
for (const notif of notifsToClose) {
|
for (const notif of notifsToClose) {
|
||||||
console.log("close previous notification");
|
console.log("close previous notification");
|
||||||
|
Loading…
Reference in New Issue
Block a user