This commit is contained in:
syuilo
2020-03-22 10:39:12 +09:00
parent c6c62f956b
commit e2c0ee66e4
7 changed files with 318 additions and 10 deletions

View File

@ -18,7 +18,7 @@ import PostFormDialog from './components/post-form-dialog.vue';
import Dialog from './components/dialog.vue';
import Menu from './components/menu.vue';
import { router } from './router';
import { applyTheme, lightTheme } from './theme';
import { applyTheme, lightTheme, builtinThemes } from './theme';
Vue.use(Vuex);
Vue.use(VueHotkey);
@ -163,6 +163,12 @@ os.init(async () => {
isMobile: isMobile
};
},
watch: {
'$store.state.device.darkMode'() {
const themes = builtinThemes.concat(this.$store.state.device.themes);
applyTheme(themes.find(x => x.id === (this.$store.state.device.darkMode ? this.$store.state.device.darkTheme : this.$store.state.device.lightTheme)));
}
},
methods: {
api: os.api,
signout: os.signout,