From d6ad9600e350e8ba78c9c8591b40a9dd3cea99b8 Mon Sep 17 00:00:00 2001 From: crusader Date: Wed, 2 Dec 2020 17:14:32 +0900 Subject: [PATCH] closeAll is added --- .../src/lib/services/notification.service.ts | 11 +++++++++++ .../src/lib/utils/animation.queue.ts | 1 + 2 files changed, 12 insertions(+) diff --git a/projects/notification-electron/src/lib/services/notification.service.ts b/projects/notification-electron/src/lib/services/notification.service.ts index 126d9c4..11c0f0b 100644 --- a/projects/notification-electron/src/lib/services/notification.service.ts +++ b/projects/notification-electron/src/lib/services/notification.service.ts @@ -201,6 +201,17 @@ export class NotificationService { }); } + closeAll(): void { + this.__animationQueue.clear(); + this.__activated.forEach(a => { + a.browserWindow.close(); + }); + this.__activated = []; + this.__delayQueue = []; + this.__closed.clear(); + this.__windowPooler.closeAll(); + } + private __show( notification: Notification ): Promise { diff --git a/projects/notification-electron/src/lib/utils/animation.queue.ts b/projects/notification-electron/src/lib/utils/animation.queue.ts index 97f30c0..552453a 100644 --- a/projects/notification-electron/src/lib/utils/animation.queue.ts +++ b/projects/notification-electron/src/lib/utils/animation.queue.ts @@ -20,6 +20,7 @@ export class AnimationQueue { clear(): void { this.__queueObjects = []; + this.__running = false; } private __animate(o: QueueObject): void {