feature: remove delay when clearing all notifications (#342)

* feat: add setting option to control delay

* Update widget/settings/pages/config/notifications/index.ts

* Update widget/settings/pages/config/notifications/index.ts

* Update widget/settings/pages/config/notifications/index.ts

---------

Co-authored-by: Jas Singh <jaskiratpal.singh@outlook.com>
This commit is contained in:
Rubin Bhandari
2024-10-21 14:35:49 +05:45
committed by GitHub
parent 604f737182
commit 3bc8c0d2e1
4 changed files with 23 additions and 8 deletions

View File

@@ -25,11 +25,11 @@ export const getNotificationIcon = (app_name: string, app_icon: string, app_entr
return icon;
};
export const closeNotifications = async (notifications: Notification[]): Promise<void> => {
export const closeNotifications = async (notifications: Notification[], delay: number): Promise<void> => {
removingNotifications.value = true;
for (const notif of notifications) {
notif.close();
await new Promise((resolve) => setTimeout(resolve, 100));
await new Promise((resolve) => setTimeout(resolve, delay));
}
removingNotifications.value = false;
};