From 0701768fd7c5bd4146a01d7e8e7edb75c283a4cd Mon Sep 17 00:00:00 2001 From: Daniel Gasienica Date: Wed, 2 May 2018 17:58:48 -0400 Subject: [PATCH] Declare globals for `drawAttention` and `isFocused` --- js/notifications.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/js/notifications.js b/js/notifications.js index 596a1a64d..2ff1e2885 100644 --- a/js/notifications.js +++ b/js/notifications.js @@ -3,7 +3,9 @@ /* global config: false */ /* global ConversationController: false */ +/* global drawAttention: false */ /* global i18n: false */ +/* global isFocused: false */ /* global Signal: false */ /* global storage: false */ /* global Whisper: false */ @@ -34,7 +36,7 @@ }, update() { const { isEnabled } = this; - const isFocused = window.isFocused(); + const isAppFocused = isFocused(); const isAudioNotificationEnabled = storage.get('audio-notification') || false; const isAudioNotificationSupported = Settings.isAudioNotificationSupported(); @@ -42,7 +44,7 @@ isAudioNotificationSupported && isAudioNotificationEnabled; const numNotifications = this.length; console.log('Update notifications:', { - isFocused, + isAppFocused, isEnabled, numNotifications, shouldPlayNotificationSound, @@ -57,7 +59,7 @@ return; } - const isNotificationOmitted = isFocused; + const isNotificationOmitted = isAppFocused; if (isNotificationOmitted) { this.clear(); return; @@ -68,7 +70,7 @@ return; } - window.drawAttention(); + drawAttention(); let title; let message;