[FIX] Remove listeners on RoomView header unmount (#874)

This commit is contained in:
Diego Mello 2019-05-04 13:46:09 -03:00 committed by GitHub
parent 6edef99d37
commit 7e513ee73a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -98,6 +98,13 @@ export default class RoomHeaderView extends Component {
return false; return false;
} }
componentWillUnmount() {
this.usersTyping.removeAllListeners();
if (this.user && this.user.removeAllListeners) {
this.user.removeAllListeners();
}
}
updateState = () => { updateState = () => {
this.setState({ usersTyping: this.usersTyping.slice() }); this.setState({ usersTyping: this.usersTyping.slice() });
} }