Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 431098b

Browse files
authored
Fixes element not remembering widget hidden state per room (#7136)
1 parent 27c3153 commit 431098b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/components/structures/RoomView.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -583,15 +583,15 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
583583

584584
// Check if user has previously chosen to hide the app drawer for this
585585
// room. If so, do not show apps
586-
const hideWidgetDrawer = localStorage.getItem(
587-
room.roomId + "_hide_widget_drawer");
586+
const hideWidgetKey = room.roomId + "_hide_widget_drawer";
587+
const hideWidgetDrawer = localStorage.getItem(hideWidgetKey);
588588

589-
// This is confusing, but it means to say that we default to the tray being
590-
// hidden unless the user clicked to open it.
591-
const isManuallyShown = hideWidgetDrawer === "false";
589+
// If unset show the Tray
590+
// Otherwise (in case the user set hideWidgetDrawer by clicking the button) follow the parameter.
591+
const isManuallyShown = hideWidgetDrawer ? hideWidgetDrawer === "false": true;
592592

593593
const widgets = WidgetLayoutStore.instance.getContainerWidgets(room, Container.Top);
594-
return widgets.length > 0 || isManuallyShown;
594+
return isManuallyShown && widgets.length > 0;
595595
}
596596

597597
componentDidMount() {

0 commit comments

Comments
 (0)