mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-17 05:55:00 +08:00
Merge pull request #3517 from matrix-org/t3chguy/fix_community_panel_preference
Fix Community Panel preference not taking effect until some refreshing
This commit is contained in:
commit
0f2eee1b1b
@ -52,8 +52,10 @@ const LeftPanel = createReactClass({
|
|||||||
componentWillMount: function() {
|
componentWillMount: function() {
|
||||||
this.focusedElement = null;
|
this.focusedElement = null;
|
||||||
|
|
||||||
this._settingWatchRef = SettingsStore.watchSetting(
|
this._breadcrumbsWatcherRef = SettingsStore.watchSetting(
|
||||||
"breadcrumbs", null, this._onBreadcrumbsChanged);
|
"breadcrumbs", null, this._onBreadcrumbsChanged);
|
||||||
|
this._tagPanelWatcherRef = SettingsStore.watchSetting(
|
||||||
|
"TagPanel.enableTagPanel", null, () => this.forceUpdate());
|
||||||
|
|
||||||
const useBreadcrumbs = !!SettingsStore.getValue("breadcrumbs");
|
const useBreadcrumbs = !!SettingsStore.getValue("breadcrumbs");
|
||||||
Analytics.setBreadcrumbs(useBreadcrumbs);
|
Analytics.setBreadcrumbs(useBreadcrumbs);
|
||||||
@ -61,7 +63,8 @@ const LeftPanel = createReactClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
componentWillUnmount: function() {
|
componentWillUnmount: function() {
|
||||||
SettingsStore.unwatchSetting(this._settingWatchRef);
|
SettingsStore.unwatchSetting(this._breadcrumbsWatcherRef);
|
||||||
|
SettingsStore.unwatchSetting(this._tagPanelWatcherRef);
|
||||||
},
|
},
|
||||||
|
|
||||||
shouldComponentUpdate: function(nextProps, nextState) {
|
shouldComponentUpdate: function(nextProps, nextState) {
|
||||||
|
Loading…
Reference in New Issue
Block a user