correctly fix notif spam after logout/login: https://github.com/vector-im/vector-web/issues/809

pull/21833/head
Matthew Hodgson 2016-03-17 02:06:47 +00:00
parent 87e1bc2f07
commit 380d466472
1 changed files with 3 additions and 3 deletions

View File

@ -103,6 +103,7 @@ var Notifier = {
MatrixClientPeg.get().on('Room.timeline', this.boundOnRoomTimeline);
MatrixClientPeg.get().on("sync", this.boundOnSyncStateChange);
this.toolbarHidden = false;
this.isPrepared = false;
},
stop: function() {
@ -110,6 +111,7 @@ var Notifier = {
MatrixClientPeg.get().removeListener('Room.timeline', this.boundOnRoomTimeline);
MatrixClientPeg.get().removeListener('sync', this.boundOnSyncStateChange);
}
this.isPrepared = false;
},
supportsDesktopNotifications: function() {
@ -203,12 +205,10 @@ var Notifier = {
},
onSyncStateChange: function(state) {
console.log("sync state change: " + state);
if (state === "PREPARED" || state === "SYNCING") {
this.isPrepared = true;
}
else if (state === "STOPPED" || state === "ERROR") {
this.isPrepared = false;
}
},
onRoomTimeline: function(ev, room, toStartOfTimeline) {