Fixes element not remembering widget hidden state per room (#7136)
This commit is contained in:
parent
27c3153947
commit
431098b56b
1 changed files with 6 additions and 6 deletions
|
@ -583,15 +583,15 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
|
||||||
|
|
||||||
// Check if user has previously chosen to hide the app drawer for this
|
// Check if user has previously chosen to hide the app drawer for this
|
||||||
// room. If so, do not show apps
|
// room. If so, do not show apps
|
||||||
const hideWidgetDrawer = localStorage.getItem(
|
const hideWidgetKey = room.roomId + "_hide_widget_drawer";
|
||||||
room.roomId + "_hide_widget_drawer");
|
const hideWidgetDrawer = localStorage.getItem(hideWidgetKey);
|
||||||
|
|
||||||
// This is confusing, but it means to say that we default to the tray being
|
// If unset show the Tray
|
||||||
// hidden unless the user clicked to open it.
|
// Otherwise (in case the user set hideWidgetDrawer by clicking the button) follow the parameter.
|
||||||
const isManuallyShown = hideWidgetDrawer === "false";
|
const isManuallyShown = hideWidgetDrawer ? hideWidgetDrawer === "false": true;
|
||||||
|
|
||||||
const widgets = WidgetLayoutStore.instance.getContainerWidgets(room, Container.Top);
|
const widgets = WidgetLayoutStore.instance.getContainerWidgets(room, Container.Top);
|
||||||
return widgets.length > 0 || isManuallyShown;
|
return isManuallyShown && widgets.length > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue