mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-01 19:18:28 -04:00
feat(ipc): add 'dismiss' function to notifications ipc (#2942)
Allow to dismiss the last visible notification only instead of resorting directly to dismissAllPopups.
This commit is contained in:
@@ -64,6 +64,10 @@ DankModal {
|
|||||||
NotificationService.dismissAllPopups();
|
NotificationService.dismissAllPopups();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function dismissLastNotification() {
|
||||||
|
NotificationService.dismissLastNotification();
|
||||||
|
}
|
||||||
|
|
||||||
modalWidth: Math.min(500, screenWidth - 48)
|
modalWidth: Math.min(500, screenWidth - 48)
|
||||||
modalHeight: Math.min(700, screenHeight * 0.85)
|
modalHeight: Math.min(700, screenHeight * 0.85)
|
||||||
backgroundColor: Theme.withAlpha(Theme.surfaceContainer, Theme.popupTransparency)
|
backgroundColor: Theme.withAlpha(Theme.surfaceContainer, Theme.popupTransparency)
|
||||||
@@ -190,6 +194,11 @@ DankModal {
|
|||||||
return "NOTIFICATION_MODAL_DISMISS_ALL_POPUPS_SUCCESS";
|
return "NOTIFICATION_MODAL_DISMISS_ALL_POPUPS_SUCCESS";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function dismiss(): string {
|
||||||
|
notificationModal.dismissLastNotification();
|
||||||
|
return "NOTIFICATION_DISMISS_SUCCESS";
|
||||||
|
}
|
||||||
|
|
||||||
target: "notifications"
|
target: "notifications"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -889,6 +889,12 @@ Singleton {
|
|||||||
NotifWrapper {}
|
NotifWrapper {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function dismissLastNotification() {
|
||||||
|
const w = visibleNotifications[visibleNotifications.length - 1];
|
||||||
|
if (w)
|
||||||
|
dismissNotification(w);
|
||||||
|
}
|
||||||
|
|
||||||
function dismissAllPopups() {
|
function dismissAllPopups() {
|
||||||
for (const w of visibleNotifications) {
|
for (const w of visibleNotifications) {
|
||||||
if (w) {
|
if (w) {
|
||||||
|
|||||||
Reference in New Issue
Block a user