diff --git a/js/notifications.js b/js/notifications.js index a37fdc19f..2e76548e7 100644 --- a/js/notifications.js +++ b/js/notifications.js @@ -27,14 +27,18 @@ }, update: function() { const isFocused = window.isFocused(); - const shouldPlayNotificationSound = Settings.isAudioNotificationSupported() && - (storage.get('audio-notification') || false); + const isAudioNotificationEnabled = storage.get('audio-notification') || false; + const isAudioNotificationSupported = Settings.isAudioNotificationSupported(); + const shouldPlayNotificationSound = isAudioNotificationSupported && + isAudioNotificationEnabled; const numNotifications = this.length; console.log( - 'updating notifications:', - 'numNotifications:', numNotifications, + 'Update notifications:', 'isFocused:', isFocused, 'isEnabled:', isEnabled, + 'numNotifications:', numNotifications, + 'isAudioNotificationEnabled:', isAudioNotificationEnabled, + 'isAudioNotificationSupported:', isAudioNotificationSupported, 'shouldPlayNotificationSound:', shouldPlayNotificationSound );