recent_topics: Avoid unnecessary rerenders via repeated Esc.

This also prevents unnecessary rerenders when changing the URL between
"#recent_topics" and "#" when it's the default view.
This commit is contained in:
Tim Abbott
2021-05-12 08:20:41 -07:00
parent 9e812c5683
commit cf69ce166c

View File

@@ -631,6 +631,11 @@ export function is_visible() {
} }
export function show() { export function show() {
if (is_visible()) {
// If we're already visible, E.g. because the user hit Esc
// while already in the recent topics view, do nothing.
return;
}
// Hide selected elements in the left sidebar. // Hide selected elements in the left sidebar.
top_left_corner.narrow_to_recent_topics(); top_left_corner.narrow_to_recent_topics();
stream_list.handle_narrow_deactivated(); stream_list.handle_narrow_deactivated();