fix:#20 first fix auto dark mode switch

This commit is contained in:
Elmar Kresse
2024-07-02 11:01:44 +02:00
parent 112a692790
commit 4f50f3a7c3
7 changed files with 83 additions and 45 deletions

View File

@@ -17,17 +17,24 @@
import { defineStore } from "pinia";
import { useLocalStorage } from "@vueuse/core";
const localeStore = defineStore("localeStore", {
const settingsStore = defineStore("settingsStore", {
state: () => {
return {
locale: useLocalStorage("locale", "en"), //useLocalStorage takes in a key of 'count' and default value of 0
isDark: true,
};
},
actions: {
setLocale(locale: string) {
this.locale = locale;
},
setDarkMode(isDark: boolean) {
this.isDark = isDark;
},
getDarkMode(): boolean {
return this.isDark;
}
},
});
export default localeStore;
export default settingsStore;