Rename enabled
--> isEnabled
This commit is contained in:
parent
59bee6690d
commit
9516d667da
1 changed files with 9 additions and 8 deletions
|
@ -13,7 +13,7 @@
|
||||||
MESSAGE : 'message'
|
MESSAGE : 'message'
|
||||||
};
|
};
|
||||||
|
|
||||||
var enabled = false;
|
let isEnabled = false;
|
||||||
var sound = new Audio('audio/NewMessage.mp3');
|
var sound = new Audio('audio/NewMessage.mp3');
|
||||||
|
|
||||||
Whisper.Notifications = new (Backbone.Collection.extend({
|
Whisper.Notifications = new (Backbone.Collection.extend({
|
||||||
|
@ -30,10 +30,11 @@
|
||||||
console.log(
|
console.log(
|
||||||
'updating notifications - count:', this.length,
|
'updating notifications - count:', this.length,
|
||||||
'focused:', isFocused,
|
'focused:', isFocused,
|
||||||
'enabled:', enabled
|
'isEnabled:', isEnabled
|
||||||
);
|
);
|
||||||
if (!enabled) {
|
|
||||||
return; // wait til we are re-enabled
|
if (!isEnabled) {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
if (this.length === 0) {
|
if (this.length === 0) {
|
||||||
return;
|
return;
|
||||||
|
@ -122,14 +123,14 @@
|
||||||
this.reset([]);
|
this.reset([]);
|
||||||
},
|
},
|
||||||
enable: function() {
|
enable: function() {
|
||||||
var update = !enabled;
|
var shouldUpdate = !isEnabled;
|
||||||
enabled = true;
|
isEnabled = true;
|
||||||
if (update) {
|
if (shouldUpdate) {
|
||||||
this.update();
|
this.update();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
disable: function() {
|
disable: function() {
|
||||||
enabled = false;
|
isEnabled = false;
|
||||||
},
|
},
|
||||||
|
|
||||||
}))();
|
}))();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue