Fix room list unable to be resized when displayed after a module (#31186)

* fix: recreate resizer when the page type changes

* test: add tests
This commit is contained in:
Florian Duros
2025-11-07 14:30:25 +01:00
committed by GitHub
parent f1bb017be7
commit f751f2a55d
2 changed files with 49 additions and 3 deletions

View File

@@ -191,14 +191,30 @@ class LoggedInView extends React.Component<IProps, IState> {
SettingsStore.watchSetting("userTimezone", null, this.onTimezoneUpdate),
];
this.resizer = this.createResizer();
this.resizer.attach();
this.loadResizer();
OwnProfileStore.instance.on(UPDATE_EVENT, this.refreshBackgroundImage);
this.loadResizerPreferences();
this.refreshBackgroundImage();
}
/**
* Load or reload the resizer for the left panel
*/
private loadResizer(): void {
// If the resizer already exists, detach it first
this.resizer?.detach();
this.resizer = this.createResizer();
this.resizer.attach();
this.loadResizerPreferences();
}
public componentDidUpdate(nextProps: Readonly<IProps>, nextState: Readonly<IState>, nextContext: any): void {
if (nextProps.page_type !== this.props.page_type) {
this.loadResizer();
}
}
private onTimezoneUpdate = async (): Promise<void> => {
// TODO: In a future app release, remove support for legacy key.
if (!SettingsStore.getValue("userTimezonePublish")) {