diff --git a/CHANGELOG.md b/CHANGELOG.md index 71253df363..c6eb7daaca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,9 @@ - Docker: Node.jsを16.6.2に - 依存関係の更新 +### Bugfixes +- Misskey更新時、テーマキャッシュの影響でスタイルがおかしくなる問題を修正 + ## 12.86.0 (2021/08/11) ### Improvements diff --git a/src/client/init.ts b/src/client/init.ts index a4a228da22..95aa18862c 100644 --- a/src/client/init.ts +++ b/src/client/init.ts @@ -16,7 +16,7 @@ import { router } from '@client/router'; import { applyTheme } from '@client/scripts/theme'; import { isDeviceDarkmode } from '@client/scripts/is-device-darkmode'; import { i18n } from '@client/i18n'; -import { stream, dialog, post } from '@client/os'; +import { stream, dialog, post, popup } from '@client/os'; import * as sound from '@client/scripts/sound'; import { $i, refreshAccount, login, updateAccount, signout } from '@client/account'; import { defaultStore, ColdDeviceStorage } from '@client/store'; @@ -198,6 +198,19 @@ if (splash) { splash.style.pointerEvents = 'none'; } +// クライアントが更新されたか? +const lastVersion = localStorage.getItem('lastVersion'); +if (lastVersion !== version) { + localStorage.setItem('lastVersion', version); + + // テーマリビルドするため + localStorage.removeItem('theme'); + + // TODO: バージョンが新しくなった時だけダイアログ出す + //popup(); +} + +// NOTE: この処理は必ず↑のクライアント更新時処理より後に来ること(テーマ再構築のため) watch(defaultStore.reactiveState.darkMode, (darkMode) => { applyTheme(darkMode ? ColdDeviceStorage.get('darkTheme') : ColdDeviceStorage.get('lightTheme')); }, { immediate: localStorage.theme == null });