ui_init: Hide sidebar when clicking a topic link on small devices.

Previously, clicking a topic link on small devices did not close
the left sidebar, and it had to be manually closed. This commit
fixes that by calling `sidebar_ui.hide_streamlist_sidebar()` when
a topic link is clicked and the left sidebar is displayed as an
overlay.
This commit is contained in:
ubaidrmn
2025-03-26 03:14:19 +05:00
committed by Tim Abbott
parent 5ad100afef
commit a9fa5b66a2

View File

@@ -686,6 +686,15 @@ export function initialize_everything(state_data) {
}
message_view.show(narrow, {trigger: "sidebar"});
if (sidebar_ui.left_sidebar_expanded_as_overlay) {
// If the left sidebar is drawn over the center pane,
// hide it so that the user can actually see the
// topic. We don't need to also hide the user list
// sidebar, since its own click-outside handler will
// hide it.
sidebar_ui.hide_streamlist_sidebar();
}
},
});
drafts.initialize_ui();