mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender-pwa.git
synced 2026-01-18 06:02:24 +01:00
fix:#20 first fix auto dark mode switch
This commit is contained in:
@@ -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;
|
||||
Reference in New Issue
Block a user