mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-17 05:47:17 +08:00
Fix Left Panel layout being wrong when filtering with 0 rooms
This commit is contained in:
parent
f73573881e
commit
d5c399dfd9
@ -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<IProps, IState> {
|
||||
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<IProps, IState> {
|
||||
};
|
||||
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user