From ead30fae9d7d318aef30f1e89ec85457a64d6402 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Wed, 29 Nov 2017 17:07:43 +0000 Subject: [PATCH] Use unmounted instead of mounted --- src/components/structures/TagPanel.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/structures/TagPanel.js b/src/components/structures/TagPanel.js index 6900b7e47b..242b71cd16 100644 --- a/src/components/structures/TagPanel.js +++ b/src/components/structures/TagPanel.js @@ -105,11 +105,11 @@ export default React.createClass({ }, componentWillMount: function() { - this.mounted = true; + this.unmounted = false; this.context.matrixClient.on("Group.myMembership", this._onGroupMyMembership); this._filterStoreToken = FilterStore.addListener(() => { - if (!this.mounted) { + if (this.unmounted) { return; } this.setState({ @@ -121,7 +121,7 @@ export default React.createClass({ }, componentWillUnmount() { - this.mounted = false; + this.unmounted = true; this.context.matrixClient.removeListener("Group.myMembership", this._onGroupMyMembership); if (this._filterStoreToken) { this._filterStoreToken.remove(); @@ -129,7 +129,7 @@ export default React.createClass({ }, _onGroupMyMembership() { - if (!this.mounted) return; + if (this.unmounted) return; this._fetchJoinedRooms(); },