diff --git a/src/components/structures/LeftPanel.tsx b/src/components/structures/LeftPanel.tsx index 4445ff3ff8..52d461edcc 100644 --- a/src/components/structures/LeftPanel.tsx +++ b/src/components/structures/LeftPanel.tsx @@ -46,6 +46,7 @@ interface IProps { } interface IState { + isFiltering: boolean; showBreadcrumbs: boolean; showGroupFilterPanel: boolean; } @@ -70,6 +71,7 @@ export default class LeftPanel extends React.Component { super(props); this.state = { + isFiltering: !!RoomListStore.instance.getFirstNameFilterCondition(), showBreadcrumbs: BreadcrumbsStore.instance.visible, showGroupFilterPanel: SettingsStore.getValue('TagPanel.enableTagPanel'), }; @@ -102,9 +104,10 @@ export default class LeftPanel extends React.Component { }; private onBreadcrumbsUpdate = () => { - const newVal = BreadcrumbsStore.instance.visible; - if (newVal !== this.state.showBreadcrumbs) { - this.setState({showBreadcrumbs: newVal}); + const showBreadcrumbs = BreadcrumbsStore.instance.visible; + const isFiltering = !!RoomListStore.instance.getFirstNameFilterCondition(); + if (showBreadcrumbs !== this.state.showBreadcrumbs || isFiltering !== this.state.isFiltering) { + this.setState({showBreadcrumbs, isFiltering}); // Update the sticky headers too as the breadcrumbs will be popping in or out. if (!this.listContainerRef.current) return; // ignore: no headers to sticky