fix theme

This commit is contained in:
2025-05-03 15:54:54 +02:00
parent 6fd64a1681
commit 7149f70cca
2 changed files with 8 additions and 17 deletions

View File

@@ -5,7 +5,7 @@ import UserLoginInfo from "../items/UserLoginInfo.vue";
import SetingsIcon from "../assets/Icons/SetingsIcon.vue";
import DarkModeIcone from "../assets/Icons/DarkModeIcone.vue";
import LightModeIcone from "../assets/Icons/LightModeIcone.vue";
import {ref} from "vue";
import {onMounted, ref} from "vue";
import router from "../router.ts";
@@ -19,6 +19,12 @@ function switchThemeMode() {
themeIs.value = newTheme;
}
onMounted(() => {
const storedTheme = localStorage.getItem("theme");
themeIs.value = storedTheme || "dark";
document.documentElement.setAttribute("data-theme", storedTheme || "dark");
});
function navigateToSettings() {
router.push("/settings");
}