mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2025-12-06 06:36:15 +00:00
refactor(notifications): Centralize dismissal logic in NotificationService
This commit is contained in:
@@ -45,10 +45,7 @@ Item {
|
||||
}
|
||||
|
||||
function dismissOldest() {
|
||||
if (NotificationService.activeList.count > 0) {
|
||||
const lastNotif = NotificationService.activeList.get(NotificationService.activeList.count - 1)
|
||||
NotificationService.dismissActiveNotification(lastNotif.id)
|
||||
}
|
||||
NotificationService.dismissOldestActive()
|
||||
}
|
||||
|
||||
function dismissAll() {
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user