Correctly unregister group store listener when unmounting RoomList
This commit is contained in:
parent
023daef4b7
commit
28e8ce967f
1 changed files with 4 additions and 2 deletions
|
@ -97,7 +97,7 @@ module.exports = React.createClass({
|
||||||
if (tag[0] !== '+') {
|
if (tag[0] !== '+') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.groupStoreToken = GroupStore.registerListener(tag, () => {
|
this._groupStoreToken = GroupStore.registerListener(tag, () => {
|
||||||
// This group's rooms or members may have updated, update rooms for its tag
|
// This group's rooms or members may have updated, update rooms for its tag
|
||||||
this.updateVisibleRoomsForTag(dmRoomMap, tag);
|
this.updateVisibleRoomsForTag(dmRoomMap, tag);
|
||||||
this.updateVisibleRooms();
|
this.updateVisibleRooms();
|
||||||
|
@ -179,7 +179,9 @@ module.exports = React.createClass({
|
||||||
}
|
}
|
||||||
|
|
||||||
// NB: GroupStore is not a Flux.Store
|
// NB: GroupStore is not a Flux.Store
|
||||||
|
if (this._groupStoreToken) {
|
||||||
this._groupStoreToken.unregister();
|
this._groupStoreToken.unregister();
|
||||||
|
}
|
||||||
|
|
||||||
// cancel any pending calls to the rate_limited_funcs
|
// cancel any pending calls to the rate_limited_funcs
|
||||||
this._delayedRefreshRoomList.cancelPendingCall();
|
this._delayedRefreshRoomList.cancelPendingCall();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue