1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-30 08:22:51 -05:00

notifications: add modal function for clearing all (#1082)

This commit is contained in:
Ethan Todd
2025-12-18 08:28:58 -05:00
committed by GitHub
parent 78a5f401d7
commit 7d81445341
2 changed files with 12 additions and 0 deletions

View File

@@ -57,6 +57,10 @@ DankModal {
} }
} }
function clearAll() {
NotificationService.clearAllNotifications();
}
modalWidth: 500 modalWidth: 500
modalHeight: 700 modalHeight: 700
backgroundColor: Theme.withAlpha(Theme.surfaceContainer, Theme.popupTransparency) backgroundColor: Theme.withAlpha(Theme.surfaceContainer, Theme.popupTransparency)
@@ -104,6 +108,11 @@ DankModal {
return "NOTIFICATION_MODAL_TOGGLE_DND_SUCCESS"; return "NOTIFICATION_MODAL_TOGGLE_DND_SUCCESS";
} }
function clearAll(): string {
notificationModal.clearAll();
return "NOTIFICATION_MODAL_CLEAR_ALL_SUCCESS";
}
target: "notifications" target: "notifications"
} }

View File

@@ -414,6 +414,9 @@ Singleton {
} }
function clearAllNotifications() { function clearAllNotifications() {
if (!notifications.length) {
return;
}
bulkDismissing = true; bulkDismissing = true;
popupsDisabled = true; popupsDisabled = true;
addGate.stop(); addGate.stop();