Merge pull request #2723 from matrix-org/travis/destate-stickerpicker

Stop listening to account data when the stickerpicker is unmounted
pull/21833/head
Travis Ralston 2019-02-28 15:01:43 -07:00 committed by GitHub
commit 940ba51f9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -103,6 +103,9 @@ export default class Stickerpicker extends React.Component {
}
componentWillUnmount() {
const client = MatrixClientPeg.get();
if (client) client.removeListener('accountData', this._updateWidget);
window.removeEventListener('resize', this._onResize);
if (this.dispatcherRef) {
dis.unregister(this.dispatcherRef);