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.

hotkey: Render default_view via changing hash.

Aman Agrawal3cb7ffd61a1b
diff --git a/static/js/hashchange.js b/static/js/hashchange.js
index 7336561beeb..e76c4791d4f 100644
--- a/static/js/hashchange.js
+++ b/static/js/hashchange.js
@@ -94,7 +94,14 @@ function show_all_message_view() {
setTimeout(navigate.maybe_scroll_to_selected, 0);
}
-export function show_default_view() {
+export function set_hash_to_default_view() {
+ window.location.hash = "";
+}
+
+function show_default_view() {
+ // This function should only be called from the hashchange
+ // handlers, as it does not set the hash to "".
+ //
// We only allow all_messages and recent_topics
// to be rendered without a hash.
if (page_params.default_view === "recent_topics") {
diff --git a/static/js/hotkey.js b/static/js/hotkey.js
index e8b3afbce7e..fb6dd01687c 100644
--- a/static/js/hotkey.js
+++ b/static/js/hotkey.js
@@ -332,7 +332,7 @@ export function process_escape_key(e) {
return true;
}
- hashchange.show_default_view();
+ hashchange.set_hash_to_default_view();
return true;
}