Make closing notifications work

This commit is contained in:
binwiederhier
2026-01-14 21:17:21 -05:00
parent 96638b516c
commit ff2b8167b4
3 changed files with 31 additions and 3 deletions

View File

@@ -55,11 +55,11 @@ export const useConnectionListeners = (account, subscriptions, users, webPushTop
// and FirebaseService::handleMessage().
if (notification.event === EVENT_MESSAGE_DELETE && notification.sequence_id) {
// Handle delete: remove notification from database
await subscriptionManager.deleteNotificationBySequenceId(subscriptionId, notification.sequence_id);
await notifier.cancel(notification);
} else if (notification.event === EVENT_MESSAGE_CLEAR && notification.sequence_id) {
// Handle read: mark notification as read
await subscriptionManager.markNotificationReadBySequenceId(subscriptionId, notification.sequence_id);
await notifier.cancel(notification);
} else {
// Regular message: delete existing and add new
const sequenceId = notification.sequence_id || notification.id;