summaryrefslogtreecommitdiffhomepage
path: root/app
diff options
context:
space:
mode:
authorJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2018-08-09 13:10:50 -0300
committerJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2018-08-09 13:10:50 -0300
commitef986b6d725772f2b7e6b351b40bae4257c41127 (patch)
tree4e10086d765201f1cb787b5ad4901b0b37eb4a2d /app
parent31aac87d59c348e60822642c5ba6c936eaed3dc7 (diff)
parentc9f175e75e4be92aed41d18a7d4d0d3569fa8f0b (diff)
downloadmullvadvpn-ef986b6d725772f2b7e6b351b40bae4257c41127.tar.xz
mullvadvpn-ef986b6d725772f2b7e6b351b40bae4257c41127.zip
Merge branch 'hide-notifications-when-window-is-active'
Diffstat (limited to 'app')
-rw-r--r--app/notification-controller.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/notification-controller.js b/app/notification-controller.js
index ff2c80db50..1d6138d404 100644
--- a/app/notification-controller.js
+++ b/app/notification-controller.js
@@ -7,6 +7,12 @@ export default class NotificationController {
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;