clear notification by toggling them off and back on
This commit is contained in:
@@ -2,6 +2,7 @@ import {
|
||||
startNotificationClient,
|
||||
subscribeNotifications,
|
||||
subscribeClientEvents,
|
||||
subscribeNotificationsCleared,
|
||||
subscribeReady,
|
||||
subscribeStatus,
|
||||
markAllNotificationsRead,
|
||||
@@ -338,6 +339,18 @@ function clearTable() {
|
||||
applyTableView();
|
||||
}
|
||||
|
||||
function removeEntriesForClient(clientId) {
|
||||
if (!clientId) return;
|
||||
let removed = false;
|
||||
for (const [uid, entry] of tableState.entries) {
|
||||
if (entry.item?.clientId === clientId) {
|
||||
tableState.entries.delete(uid);
|
||||
removed = true;
|
||||
}
|
||||
}
|
||||
if (removed) applyTableView();
|
||||
}
|
||||
|
||||
// ── Client ID cell (collapsed by default, click to expand) ──────────────────
|
||||
const CLIENT_ID_SHORT_LEN = 8;
|
||||
|
||||
@@ -718,6 +731,7 @@ function connect() {
|
||||
|
||||
subscribeNotifications((item) => addNotification(item, true));
|
||||
subscribeClientEvents((item) => addClientEvent(item));
|
||||
subscribeNotificationsCleared((clientId) => removeEntriesForClient(clientId));
|
||||
}
|
||||
|
||||
const CLIENT_EVENT_BADGE = {
|
||||
|
||||
Reference in New Issue
Block a user