overlays: Use `close_overlay` to close overlays!

It is unusal to use a hack to close overlays when there is a method
to do it.

This fixes a bug where user is unable to scroll message feed
after opening an overlay and then using browser back button.

This could have easily cause other bugs too.
This commit is contained in:
Aman Agrawal 2023-05-29 19:10:21 +05:30 committed by Tim Abbott
parent db26f2b2fc
commit ea9992d853
1 changed files with 2 additions and 3 deletions

View File

@ -385,9 +385,8 @@ export function close_active_modal(): void {
}
export function close_for_hash_change(): void {
$("div.overlay.show").removeClass("show");
if (active_overlay) {
active_overlay.close_handler();
if (open_overlay_name) {
close_overlay(open_overlay_name);
}
}