Merge pull request #476 from lonerOrz/feat/ipc-notification-dismiss

feat(ipc): Add commands to dismiss notifications
This commit is contained in:
Lemmy
2025-10-13 09:00:34 -04:00
committed by GitHub
2 changed files with 15 additions and 0 deletions
+8
View File
@@ -43,6 +43,14 @@ Item {
function clear() {
NotificationService.clearHistory()
}
function dismissOldest() {
NotificationService.dismissOldestActive()
}
function dismissAll() {
NotificationService.dismissAllActive()
}
}
IpcHandler {
+7
View File
@@ -414,6 +414,13 @@ Singleton {
removeActive(id)
}
function dismissOldestActive() {
if (activeList.count > 0) {
const lastNotif = activeList.get(activeList.count - 1)
dismissActiveNotification(lastNotif.id)
}
}
function dismissAllActive() {
Object.values(activeMap).forEach(n => n.dismiss())
activeList.clear()