Fix to show the correct room

This commit is contained in:
Luke Barnard 2017-06-01 18:01:30 +01:00
parent 8192374481
commit 16c4c14a16
2 changed files with 51 additions and 23 deletions

View file

@ -171,7 +171,7 @@ module.exports = React.createClass({
});
// Start listening for RoomViewStore updates
RoomViewStore.addListener(this._onRoomViewStoreUpdate);
this._roomStoreToken = RoomViewStore.addListener(this._onRoomViewStoreUpdate);
this._onRoomViewStoreUpdate(true);
},
@ -182,6 +182,8 @@ module.exports = React.createClass({
this.setState({
roomId: RoomViewStore.getRoomId(),
roomAlias: RoomViewStore.getRoomAlias(),
roomLoading: RoomViewStore.isRoomLoading(),
roomLoadError: RoomViewStore.getRoomLoadError(),
joining: RoomViewStore.isJoining(),
joinError: RoomViewStore.getJoinError(),
}, () => {
@ -343,6 +345,11 @@ module.exports = React.createClass({
document.removeEventListener("keydown", this.onKeyDown);
// Remove RoomStore listener
if (this._roomStoreToken) {
this._roomStoreToken.remove();
}
// cancel any pending calls to the rate_limited_funcs
this._updateRoomMembers.cancelPendingCall();