From d5f6d781bb358f8f31c7ec930bfb04e374987ecb Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 3 Oct 2019 22:13:10 +0100 Subject: [PATCH 1/2] Fix Community Panel preference not taking effect until some refreshing Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/structures/LeftPanel.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/structures/LeftPanel.js b/src/components/structures/LeftPanel.js index fd315d2540..d57aff4696 100644 --- a/src/components/structures/LeftPanel.js +++ b/src/components/structures/LeftPanel.js @@ -54,6 +54,8 @@ const LeftPanel = createReactClass({ this._settingWatchRef = SettingsStore.watchSetting( "breadcrumbs", null, this._onBreadcrumbsChanged); + this._settingWatchRef1 = SettingsStore.watchSetting( + "TagPanel.enableTagPanel", null, () => this.forceUpdate()); const useBreadcrumbs = !!SettingsStore.getValue("breadcrumbs"); Analytics.setBreadcrumbs(useBreadcrumbs); @@ -62,6 +64,7 @@ const LeftPanel = createReactClass({ componentWillUnmount: function() { SettingsStore.unwatchSetting(this._settingWatchRef); + SettingsStore.unwatchSetting(this._settingWatchRef1); }, shouldComponentUpdate: function(nextProps, nextState) { From 9e9c56d327b3e88c253d21d7727b28b870655b06 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 3 Oct 2019 23:21:32 +0100 Subject: [PATCH 2/2] rename settings watcher refs in LeftPanel Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/structures/LeftPanel.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/structures/LeftPanel.js b/src/components/structures/LeftPanel.js index d57aff4696..36dd3a7a61 100644 --- a/src/components/structures/LeftPanel.js +++ b/src/components/structures/LeftPanel.js @@ -52,9 +52,9 @@ const LeftPanel = createReactClass({ componentWillMount: function() { this.focusedElement = null; - this._settingWatchRef = SettingsStore.watchSetting( + this._breadcrumbsWatcherRef = SettingsStore.watchSetting( "breadcrumbs", null, this._onBreadcrumbsChanged); - this._settingWatchRef1 = SettingsStore.watchSetting( + this._tagPanelWatcherRef = SettingsStore.watchSetting( "TagPanel.enableTagPanel", null, () => this.forceUpdate()); const useBreadcrumbs = !!SettingsStore.getValue("breadcrumbs"); @@ -63,8 +63,8 @@ const LeftPanel = createReactClass({ }, componentWillUnmount: function() { - SettingsStore.unwatchSetting(this._settingWatchRef); - SettingsStore.unwatchSetting(this._settingWatchRef1); + SettingsStore.unwatchSetting(this._breadcrumbsWatcherRef); + SettingsStore.unwatchSetting(this._tagPanelWatcherRef); }, shouldComponentUpdate: function(nextProps, nextState) {