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.

hashchange: Show default view behind overlays on load.

Tim Abbott9e812c568397
diff --git a/frontend_tests/node_tests/hashchange.js b/frontend_tests/node_tests/hashchange.js
index 4d6d01cd95c..b99b50bf752 100644
--- a/frontend_tests/node_tests/hashchange.js
+++ b/frontend_tests/node_tests/hashchange.js
@@ -6,6 +6,7 @@ const {mock_cjs, mock_esm, set_global, zrequire} = require("../zjsunit/namespace
const {run_test} = require("../zjsunit/test");
const blueslip = require("../zjsunit/zblueslip");
const $ = require("../zjsunit/zjquery");
+const {page_params} = require("../zjsunit/zpage_params");
mock_cjs("jquery", $);
let window_stub;
@@ -167,6 +168,7 @@ function test_helper({override, change_tab}) {
run_test("hash_interactions", (override) => {
window_stub = $.create("window-stub");
+ page_params.default_view = "recent_topics";
override(recent_topics, "show", () => {});
override(recent_topics, "is_visible", () => false);
diff --git a/static/js/hashchange.js b/static/js/hashchange.js
index 4de41cb53cc..7336561beeb 100644
--- a/static/js/hashchange.js
+++ b/static/js/hashchange.js
@@ -177,12 +177,9 @@ function do_hashchange_normal(from_reload) {
function do_hashchange_overlay(old_hash) {
if (old_hash === undefined) {
- // User directly requested to open an overlay.
- // We need to show recent topics in the background.
- // Even though recent topics may not be the default view
- // here, we show it because we need to show a view in
- // background and recent topics seems preferable for that.
- recent_topics.show();
+ // The user opened the app with an overlay hash; we need to
+ // show the user's default view behind it.
+ show_default_view();
}
const base = hash_util.get_current_hash_category();
const old_base = hash_util.get_hash_category(old_hash);