From 380d4664726931b45fbb1e61069754717f95254f Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Thu, 17 Mar 2016 02:06:47 +0000 Subject: [PATCH] correctly fix notif spam after logout/login: https://github.com/vector-im/vector-web/issues/809 --- src/Notifier.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Notifier.js b/src/Notifier.js index f0d38bd7b2..523c259cf4 100644 --- a/src/Notifier.js +++ b/src/Notifier.js @@ -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) {