From 90ba51ee9c981252c96585231a9ddf74a3f1c80e Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 22 Mar 2020 20:23:35 +0900 Subject: [PATCH 1/2] Fix dark mode sync --- src/client/init.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/client/init.ts b/src/client/init.ts index aed7ff85e8..c7587afb8c 100644 --- a/src/client/init.ts +++ b/src/client/init.ts @@ -19,6 +19,7 @@ import Dialog from './components/dialog.vue'; import Menu from './components/menu.vue'; import { router } from './router'; import { applyTheme, lightTheme, builtinThemes } from './theme'; +import { isDeviceDarkmode } from './scripts/is-device-darkmode'; Vue.use(Vuex); Vue.use(VueHotkey); @@ -144,11 +145,17 @@ os.init(async () => { } }, false) + //#region Sync dark mode + if (os.store.state.device.syncDeviceDarkMode) { + os.store.commit('device/set', { key: 'darkMode', value: isDeviceDarkmode() }); + } + window.matchMedia('(prefers-color-scheme: dark)').addListener(mql => { if (os.store.state.device.syncDeviceDarkMode) { os.store.commit('device/set', { key: 'darkMode', value: mql.matches }); } }); + //#endregion if ('Notification' in window && os.store.getters.isSignedIn) { // 許可を得ていなかったらリクエスト From 4ea65dbe41fba85bfc0d764d05ce7e51355f93be Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 22 Mar 2020 20:23:47 +0900 Subject: [PATCH 2/2] 12.24.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2d056c40ff..096ab58eda 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "misskey", "author": "syuilo ", - "version": "12.24.1", + "version": "12.24.2", "codename": "indigo", "repository": { "type": "git",