Extract isAudioNotificationEnabled constant

This commit is contained in:
Daniel Gasienica 2018-03-01 19:58:51 -05:00
parent dc38d40f20
commit a5a4ed7de7

View file

@ -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
);