Cancel calls to rate-limited funcs on unmount

The tests were throwing up warnings about state being accessed, and null
MatrixClients being called, after component unmount.
This commit is contained in:
Richard van der Hoff 2016-08-10 13:39:47 +01:00
parent 6aa5e5a493
commit 8fe470bce1
5 changed files with 34 additions and 3 deletions

View file

@ -101,6 +101,8 @@ module.exports = React.createClass({
MatrixClientPeg.get().removeListener("RoomState.events", this.onRoomStateEvents);
MatrixClientPeg.get().removeListener("RoomMember.name", this.onRoomMemberName);
}
// cancel any pending calls to the rate_limited_funcs
this._delayedRefreshRoomList.cancelPendingCall();
},
onRoom: function(room) {