Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

narrow: Move maybe_scroll_to_selected call.

Tim Abbott7a6f288fab53
diff --git a/web/src/hashchange.js b/web/src/hashchange.js
index d79e88389c2..c21e932ec66 100644
--- a/web/src/hashchange.js
+++ b/web/src/hashchange.js
@@ -52,9 +52,6 @@ function maybe_hide_inbox() {
function show_all_message_view() {
narrow.deactivate();
- // We need to maybe scroll to the selected message
- // once we have the proper viewport set up
- message_viewport.maybe_scroll_to_selected();
}
export function set_hash_to_home_view() {
diff --git a/web/src/narrow.js b/web/src/narrow.js
index 606085e7ea8..88860c94f6d 100644
--- a/web/src/narrow.js
+++ b/web/src/narrow.js
@@ -970,6 +970,10 @@ function handle_post_narrow_deactivate_processes(msg_list) {
message_edit.handle_narrow_deactivated();
widgetize.set_widgets_for_list();
message_feed_top_notices.update_top_of_narrow_notices(msg_list);
+
+ // We may need to scroll to the selected message after swapping
+ // the currently displayed center panel to zhome.
+ message_viewport.maybe_scroll_to_selected();
}
export function deactivate() {