From 3165489f58e586082858f54eabfe8e34e29c2bec Mon Sep 17 00:00:00 2001 From: Aevann Date: Fri, 4 Aug 2023 19:28:34 +0300 Subject: [PATCH] try smth to fix edge case jumps --- files/assets/js/core.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/files/assets/js/core.js b/files/assets/js/core.js index 469174f9b..b92ea60bf 100644 --- a/files/assets/js/core.js +++ b/files/assets/js/core.js @@ -604,7 +604,11 @@ if (screen_width <= 768) { }); addEventListener('hashchange', function () { - if(location.hash != "#modal") { + if (location.hash == "#modal") { + const curr_modal = bootstrap.Modal.getInstance(document.getElementsByClassName('show')[0]) + if (!curr_modal) history.back(); + } + else { const curr_modal = bootstrap.Modal.getInstance(document.getElementsByClassName('show')[0]) if (curr_modal) curr_modal.hide() }