From 92937b8b3cbef001154501d2ef25aa5277c31f5b Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 22 Mar 2020 10:57:58 +0900 Subject: [PATCH] Update theme.vue --- src/client/pages/preferences/theme.vue | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/client/pages/preferences/theme.vue b/src/client/pages/preferences/theme.vue index 2111cd7ae..488935a0c 100644 --- a/src/client/pages/preferences/theme.vue +++ b/src/client/pages/preferences/theme.vue @@ -63,6 +63,7 @@ import MkSwitch from '../../components/ui/switch.vue'; import i18n from '../../i18n'; import { Theme, builtinThemes, applyTheme } from '../../theme'; import { selectFile } from '../../scripts/select-file'; +import { isDeviceDarkmode } from '../../scripts/is-device-darkmode'; export default Vue.extend({ i18n, @@ -132,6 +133,12 @@ export default Vue.extend({ } }, + syncDeviceDarkMode() { + if (this.$store.state.device.syncDeviceDarkMode) { + this.$store.commit('device/set', { key: 'darkMode', value: isDeviceDarkmode() }); + } + }, + wallpaper() { if (this.wallpaper == null) { localStorage.removeItem('wallpaper');