mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-17 05:55:00 +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 {
|
interface IState {
|
||||||
|
isFiltering: boolean;
|
||||||
showBreadcrumbs: boolean;
|
showBreadcrumbs: boolean;
|
||||||
showGroupFilterPanel: boolean;
|
showGroupFilterPanel: boolean;
|
||||||
}
|
}
|
||||||
@ -70,6 +71,7 @@ export default class LeftPanel extends React.Component<IProps, IState> {
|
|||||||
super(props);
|
super(props);
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
|
isFiltering: !!RoomListStore.instance.getFirstNameFilterCondition(),
|
||||||
showBreadcrumbs: BreadcrumbsStore.instance.visible,
|
showBreadcrumbs: BreadcrumbsStore.instance.visible,
|
||||||
showGroupFilterPanel: SettingsStore.getValue('TagPanel.enableTagPanel'),
|
showGroupFilterPanel: SettingsStore.getValue('TagPanel.enableTagPanel'),
|
||||||
};
|
};
|
||||||
@ -102,9 +104,10 @@ export default class LeftPanel extends React.Component<IProps, IState> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
private onBreadcrumbsUpdate = () => {
|
private onBreadcrumbsUpdate = () => {
|
||||||
const newVal = BreadcrumbsStore.instance.visible;
|
const showBreadcrumbs = BreadcrumbsStore.instance.visible;
|
||||||
if (newVal !== this.state.showBreadcrumbs) {
|
const isFiltering = !!RoomListStore.instance.getFirstNameFilterCondition();
|
||||||
this.setState({showBreadcrumbs: newVal});
|
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.
|
// Update the sticky headers too as the breadcrumbs will be popping in or out.
|
||||||
if (!this.listContainerRef.current) return; // ignore: no headers to sticky
|
if (!this.listContainerRef.current) return; // ignore: no headers to sticky
|
||||||
|
Loading…
Reference in New Issue
Block a user