correctly fix notif spam after logout/login: https://github.com/vector-im/vector-web/issues/809
							parent
							
								
									87e1bc2f07
								
							
						
					
					
						commit
						380d466472
					
				|  | @ -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) { | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	 Matthew Hodgson
						Matthew Hodgson