hashchange: Show recent topics if overlay hash in initial URl.

When user directly has hash for overlay in the URL when app loads,
we need to still show recent topics in the background. This
doesn't need to happen in other cases when user is accessing
the overlay after UI is loaded.
This commit is contained in:
Aman Agrawal 2020-11-04 13:40:18 +05:30 committed by Tim Abbott
parent 39d123e355
commit 7fc28eaa16
1 changed files with 5 additions and 0 deletions

View File

@ -155,6 +155,11 @@ function do_hashchange_normal(from_reload) {
} }
function do_hashchange_overlay(old_hash) { 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.
recent_topics.show();
}
const base = hash_util.get_hash_category(window.location.hash); const base = hash_util.get_hash_category(window.location.hash);
const old_base = hash_util.get_hash_category(old_hash); const old_base = hash_util.get_hash_category(old_hash);
const section = hash_util.get_hash_section(window.location.hash); const section = hash_util.get_hash_section(window.location.hash);