summaryrefslogtreecommitdiffhomepage
path: root/app/notification-controller.js
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@mullvad.net>2018-07-18 15:07:37 +0200
committerAndrej Mihajlov <and@mullvad.net>2018-08-15 17:39:38 +0200
commit71592249b2dd669b6f24f37bfb7b0f4e43b74998 (patch)
treea6097dc7e5d94d06e99c65fdfe160e824395f50c /app/notification-controller.js
parente84e87f4ce5a8c242f756566cdc6fb59a45f7bea (diff)
downloadmullvadvpn-71592249b2dd669b6f24f37bfb7b0f4e43b74998.tar.xz
mullvadvpn-71592249b2dd669b6f24f37bfb7b0f4e43b74998.zip
Add workspaces
Diffstat (limited to 'app/notification-controller.js')
-rw-r--r--app/notification-controller.js32
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();
- }
- }
-}