From 245142c833577d388ac2bb320aea603a117a08d3 Mon Sep 17 00:00:00 2001 From: Zan <62830223+Zan1456@users.noreply.github.com> Date: Wed, 10 Sep 2025 15:27:43 +0200 Subject: [PATCH] Fix loading remove --- logout/logout.js | 12 +++++++++++- tools/loadingScreen.js | 8 +++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/logout/logout.js b/logout/logout.js index 49d01dc..132d68b 100644 --- a/logout/logout.js +++ b/logout/logout.js @@ -65,8 +65,18 @@ } if (document.readyState === "loading") { - document.addEventListener("DOMContentLoaded", transformLogoutPage); + document.addEventListener("DOMContentLoaded", () => { + setTimeout(() => { + if (typeof loadingScreen !== 'undefined') { + loadingScreen.hide(); + } + }, 100); + transformLogoutPage(); + }); } else { + if (typeof loadingScreen !== 'undefined') { + loadingScreen.hide(); + } transformLogoutPage(); } })(); \ No newline at end of file diff --git a/tools/loadingScreen.js b/tools/loadingScreen.js index d7fbc2a..29bb65b 100644 --- a/tools/loadingScreen.js +++ b/tools/loadingScreen.js @@ -65,7 +65,13 @@ window.addEventListener("DOMContentLoaded", () => { }); } - if (urls.some((url) => url.includes(location.pathname))) { + const currentUrl = location.href; + const shouldShowLoading = urls.some((urlPattern) => { + const regex = new RegExp(urlPattern.replace(/\*/g, '.*')); + return regex.test(currentUrl); + }); + + if (shouldShowLoading) { loadingScreen.show(); } });