Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
narrow: Clarify first parameter to deactivate.
Tim Abbott03f3e17a4033
diff --git a/web/src/hashchange.js b/web/src/hashchange.jsindex d667f722dae..cc2e2688eba 100644--- a/web/src/hashchange.js+++ b/web/src/hashchange.js@@ -55,7 +55,7 @@ function show_all_message_view() {const coming_from_recent_view = maybe_hide_recent_view();const coming_from_inbox = maybe_hide_inbox();const is_actively_scrolling = message_scroll.is_actively_scrolling();- narrow.deactivate(!(coming_from_recent_view || coming_from_inbox), is_actively_scrolling);+ narrow.deactivate(coming_from_recent_view || coming_from_inbox, is_actively_scrolling);// We need to maybe scroll to the selected message// once we have the proper viewport set upsetTimeout(message_viewport.maybe_scroll_to_selected, 0);diff --git a/web/src/narrow.js b/web/src/narrow.jsindex 499c746e217..e17e8b547e7 100644--- a/web/src/narrow.js+++ b/web/src/narrow.js@@ -970,7 +970,7 @@ function handle_post_narrow_deactivate_processes(msg_list) {message_feed_top_notices.update_top_of_narrow_notices(msg_list);}-export function deactivate(coming_from_all_messages = true, is_actively_scrolling = false) {+export function deactivate(message_feed_previously_hidden = false, is_actively_scrolling = false) {// NOTE: Never call this function independently,// always use browser_history.go_to_location("#all_messages") to// activate All message narrow.@@ -989,7 +989,7 @@ export function deactivate(coming_from_all_messages = true, is_actively_scrollinsearch.clear_search_form();// Both All messages and Recent Conversations have `undefined` filter.// Return if already in the All message narrow.- if (narrow_state.filter() === undefined && coming_from_all_messages) {+ if (narrow_state.filter() === undefined && !message_feed_previously_hidden) {return;}blueslip.debug("Unnarrowed");@@ -997,7 +997,7 @@ export function deactivate(coming_from_all_messages = true, is_actively_scrollinif (is_actively_scrolling) {// There is no way to intercept in-flight scroll events, and they will// cause you to end up in the wrong place if you are actively scrolling- // on an unnarrow. Wait a bit and try again once the scrolling is over.+ // on an unnarrow. Wait a bit and try again once the scrolling is likely over.setTimeout(deactivate, 50);return;}