fix light/dark theme not currectly initializing on shared report, unify logic

This commit is contained in:
Gregor Vostrak
2025-04-30 13:32:25 +02:00
parent da5fc3f113
commit 7673b365ca
4 changed files with 21 additions and 17 deletions

View File

@@ -1,13 +1,9 @@
<script setup lang="ts">
import { onMounted, watch } from "vue";
import { theme } from "@/utils/theme.js";
import { onMounted } from "vue";
import { useTheme } from "@/utils/theme.js";
onMounted(async () => {
document.documentElement.classList.add(theme.value);
watch(theme, (newTheme, oldTheme) => {
document.documentElement.classList.remove(oldTheme);
document.documentElement.classList.add(newTheme);
});
useTheme()
});
</script>