Merge pull request #1084 from matrix-org/rav/remove_roomstore_listener

remove RoomViewStore listener from MatrixChat on unmount
pull/21833/head
Richard van der Hoff 2017-06-13 13:10:49 +01:00 committed by GitHub
commit 392cd7861d
1 changed files with 2 additions and 1 deletions

View File

@ -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() {