Merge pull request #4143 from matrix-org/t3chguy/disabled_llp
Clear selected tags when disabling tag panel
This commit is contained in:
commit
b6bc8a6456
1 changed files with 10 additions and 0 deletions
|
@ -19,6 +19,7 @@ import GroupStore from './GroupStore';
|
||||||
import Analytics from '../Analytics';
|
import Analytics from '../Analytics';
|
||||||
import * as RoomNotifs from "../RoomNotifs";
|
import * as RoomNotifs from "../RoomNotifs";
|
||||||
import {MatrixClientPeg} from '../MatrixClientPeg';
|
import {MatrixClientPeg} from '../MatrixClientPeg';
|
||||||
|
import SettingsStore from "../settings/SettingsStore";
|
||||||
|
|
||||||
const INITIAL_STATE = {
|
const INITIAL_STATE = {
|
||||||
orderedTags: null,
|
orderedTags: null,
|
||||||
|
@ -40,6 +41,7 @@ class TagOrderStore extends Store {
|
||||||
|
|
||||||
// Initialise state
|
// Initialise state
|
||||||
this._state = Object.assign({}, INITIAL_STATE);
|
this._state = Object.assign({}, INITIAL_STATE);
|
||||||
|
SettingsStore.monitorSetting("TagPanel.enableTagPanel", null);
|
||||||
}
|
}
|
||||||
|
|
||||||
_setState(newState) {
|
_setState(newState) {
|
||||||
|
@ -178,6 +180,14 @@ class TagOrderStore extends Store {
|
||||||
this._state = Object.assign({}, INITIAL_STATE);
|
this._state = Object.assign({}, INITIAL_STATE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 'setting_updated':
|
||||||
|
if (payload.settingName === 'TagPanel.enableTagPanel' && !payload.newValue) {
|
||||||
|
this._setState({
|
||||||
|
selectedTags: [],
|
||||||
|
});
|
||||||
|
Analytics.trackEvent('FilterStore', 'disable_tags');
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue