Add some resource leak protection to new room list badges

Most of the leaks were because we never set `this.rooms` in the notification state, which meant we were constantly triggering the `diff.added` loop.
This commit is contained in:
Travis Ralston 2020-06-10 16:04:27 -06:00
parent d3a3b54a82
commit d1c2ecb6cc
2 changed files with 18 additions and 1 deletions

View file

@ -84,6 +84,10 @@ export default class RoomSublist2 extends React.Component<IProps, IState> {
this.state.notificationState.setRooms(this.props.rooms);
}
public componentWillUnmount() {
this.state.notificationState.destroy();
}
private onAddRoom = (e) => {
e.stopPropagation();
if (this.props.onAddRoom) this.props.onAddRoom();