UI: fix stray element in theme.html

This commit is contained in:
Pieter Vander Vennet 2025-01-30 14:50:40 +01:00
parent f26f22a95c
commit 1af21714f2
2 changed files with 20 additions and 18 deletions

View file

@ -5,13 +5,17 @@ import CustomThemeError from "./UI/CustomThemeError.svelte"
async function main() {
const target = document.getElementById("maindiv")
const childs = Array.from(target.children)
try {
childs.forEach((ch) => target.removeChild(ch))
} catch (e) {
console.error("Huh? Couldn't remove child!")
}
try {
const theme = await DetermineTheme.getTheme()
new SingleThemeGui({
target,
props: { theme },
})
childs.forEach((ch) => target.removeChild(ch))
Array.from(document.getElementsByClassName("delete-on-load")).forEach((el) => {
el.parentElement.removeChild(el)
})