diff options
Diffstat (limited to 'app/notification-controller.js')
| -rw-r--r-- | app/notification-controller.js | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/app/notification-controller.js b/app/notification-controller.js deleted file mode 100644 index 1d6138d404..0000000000 --- a/app/notification-controller.js +++ /dev/null @@ -1,32 +0,0 @@ -// @flow - -import { remote } from 'electron'; - -export default class NotificationController { - _activeNotification: ?Notification; - - show(message: string) { - const lastNotification = this._activeNotification; - const sameAsLastNotification = lastNotification && lastNotification.body === message; - - if (sameAsLastNotification || remote.getCurrentWindow().isVisible()) { - return; - } - - const newNotification = new Notification(remote.app.getName(), { body: message, silent: true }); - - this._activeNotification = newNotification; - - newNotification.addEventListener('show', () => { - // If the notification is closed too soon, it might still get shown. If that happens, close() - // should be called again so that it is closed immediately. - if (this._activeNotification !== newNotification) { - newNotification.close(); - } - }); - - if (lastNotification) { - lastNotification.close(); - } - } -} |
