From b5ffd4a538882c7f1633463054d3904fc5bc4db5 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 28 Feb 2019 14:15:01 -0700 Subject: [PATCH] Stop listening to account data when the stickerpicker is unmounted Fixes https://github.com/vector-im/riot-web/issues/8994 --- src/components/views/rooms/Stickerpicker.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/views/rooms/Stickerpicker.js b/src/components/views/rooms/Stickerpicker.js index 0d7f808d23..c65720a32b 100644 --- a/src/components/views/rooms/Stickerpicker.js +++ b/src/components/views/rooms/Stickerpicker.js @@ -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);