Fix loading remove

This commit is contained in:
Zan
2025-09-10 15:27:43 +02:00
parent 7e1d4cd9a7
commit 245142c833
2 changed files with 18 additions and 2 deletions

View File

@@ -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();
}
})();

View File

@@ -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();
}
});