From 692c942fe75c770cff2f6e96a4c36eb4c4e4f54e Mon Sep 17 00:00:00 2001 From: PhilReact Date: Thu, 31 Oct 2024 17:35:47 +0200 Subject: [PATCH] fixed notifications --- src/background.ts | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/background.ts b/src/background.ts index dea4c45..9686529 100644 --- a/src/background.ts +++ b/src/background.ts @@ -394,7 +394,11 @@ const handleNotificationDirect = async (directs) => { (newestLatestTimestamp && newestLatestTimestamp?.timestamp > oldestLatestTimestamp?.timestamp) ) { - + const notificationId = + "chat_notification_" + + Date.now() + + "_type=direct" + + `_from=${newestLatestTimestamp.address}`; LocalNotifications.schedule({ notifications: [ @@ -426,8 +430,11 @@ const handleNotificationDirect = async (directs) => { ); }); - const notificationId = "chat_notification_" + Date.now(); - + const notificationId = + "chat_notification_" + + Date.now() + + "_type=direct" + + `_from=${newestLatestTimestamp.address}`; LocalNotifications.schedule({ notifications: [ { @@ -620,11 +627,7 @@ const handleNotification = async (groups) => { } ] }); - if (!isMobile) { - setTimeout(() => { - chrome.notifications.clear(notificationId); - }, 7000); - } + lastGroupNotification = Date.now(); } }