diff --git a/static/js/hashchange.js b/static/js/hashchange.js index 7336561bee..e76c4791d4 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 e8b3afbce7..fb6dd01687 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; }