From 1ea9ed5d8c4c599e68edff0a24b21b9f0cc40328 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Tue, 13 Jun 2017 09:45:07 +0100 Subject: [PATCH] remove RoomViewStore listener from MatrixChat on unmount ... to avoid spurious warnings from the tests. --- src/components/structures/MatrixChat.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index 1065fa9f9f..a2a2c30889 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -186,7 +186,7 @@ module.exports = React.createClass({ componentWillMount: function() { SdkConfig.put(this.props.config); - RoomViewStore.addListener(this._onRoomViewStoreUpdated); + this._roomViewStoreToken = RoomViewStore.addListener(this._onRoomViewStoreUpdated); this._onRoomViewStoreUpdated(); if (!UserSettingsStore.getLocalSetting('analyticsOptOut', false)) Analytics.enable(); @@ -295,6 +295,7 @@ module.exports = React.createClass({ UDEHandler.stopListening(); window.removeEventListener("focus", this.onFocus); window.removeEventListener('resize', this.handleResize); + this._roomViewStoreToken.remove(); }, componentDidUpdate: function() {