Fix settings bug.. again.

This commit is contained in:
wearrrrr 2024-02-21 10:55:27 -06:00
parent f1ace2f821
commit 9ae1e5220f
2 changed files with 6 additions and 4 deletions

View file

@ -47,13 +47,13 @@ const t = useTranslations(lang);
<div id="current-content"></div>
</div>
<script is:inline>
window.loadedContentStorage = {};
window.currentlySelectedTab;
function settingsLoad() {
document.addEventListener("astro:after-swap", () => {
window.currentlySelectedTab = "";
document.removeEventListener("setting-tabChange", determineListener);
});
window.currentlySelectedTab;
window.loadedContentStorage = {};
Array.from(document.getElementsByClassName("setting-tab")).forEach((tab) => {
let contentToLoad = document.getElementById("content-" + tab.id);
if (contentToLoad) {
@ -344,7 +344,10 @@ const t = useTranslations(lang);
}
}
document.addEventListener('astro:after-swap', () => {
settingsLoad()
setTimeout(() => {
settingsLoad();
}, 300);
})
settingsLoad()
</script>

View file

@ -26,7 +26,6 @@ const { title, optionalPreloads } = Astro.props;
<ThemeLoader transition:persist />
<CloakLoader transition:persist />
<meta charset="UTF-8" />
<meta name="description" content="Astro description" />
<meta name="viewport" content="width=device-width" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />