1
0
mirror of https://github.com/zumbiepig/MineXLauncher.git synced 2025-06-26 10:05:10 +00:00

fix the bug where the theme flickers

This commit is contained in:
zumbiepig
2024-09-03 20:35:52 -07:00
parent 1f5223c96f
commit 2597e40ba1
14 changed files with 27 additions and 34 deletions

View File

@@ -369,14 +369,7 @@ if (window.location.pathname === '/') {
if (iframe.contentWindow) iframe.contentWindow.installPwaEvent = event;
});
} else {
document.addEventListener('DOMContentLoaded', () => {
const themeElement = document.getElementById('theme') as HTMLLinkElement;
if (themeElement) {
document.documentElement.style.display = 'none';
themeElement.onload = () => (document.documentElement.style.display = '');
themeElement.href = `/resources/styles/themes/${storage.local.get('theme') ?? 'default'}.css`;
}
});
theme.load();
document.addEventListener('DOMContentLoaded', async () => {
const profileName = document.getElementById('profile-name');