browser_history: If changing_hash, don't set to hash_before_overlay.

If we are changing_hash, it means `window.location.hash` is the
new_hash, so we don't want to change hash further now.

This used to create a loop of changing hashes as we used to close
and open overlays if `hash_before_overlay` was an overlay.

Fixes #18011
This commit is contained in:
Aman Agrawal
2021-04-09 12:00:50 +00:00
committed by Tim Abbott
parent bd17d98e94
commit 40acc9b27c

View File

@@ -55,7 +55,7 @@ export function update(new_hash) {
}
export function exit_overlay() {
if (hash_util.is_overlay_hash(window.location.hash)) {
if (hash_util.is_overlay_hash(window.location.hash) && !state.changing_hash) {
ui_util.blur_active_element();
const new_hash = state.hash_before_overlay || "#";
update(new_hash);