diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2020-03-22 10:59:27 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2020-03-22 10:59:27 +0900 |
| commit | 7f0084a7ede7a3950ea6bdaeadd744f602d010cf (patch) | |
| tree | e339d8002b094f18dccabf364479aaab056ee0dd /src/client/init.ts | |
| parent | Merge branch 'develop' (diff) | |
| parent | 12.23.0 (diff) | |
| download | misskey-7f0084a7ede7a3950ea6bdaeadd744f602d010cf.tar.gz misskey-7f0084a7ede7a3950ea6bdaeadd744f602d010cf.tar.bz2 misskey-7f0084a7ede7a3950ea6bdaeadd744f602d010cf.zip | |
Merge branch 'develop'
Diffstat (limited to 'src/client/init.ts')
| -rw-r--r-- | src/client/init.ts | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/client/init.ts b/src/client/init.ts index 29eabfee4e..f1790ac4d9 100644 --- a/src/client/init.ts +++ b/src/client/init.ts @@ -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, |