Skip to content
Snippets Groups Projects
Commit c88ea715 authored by syuilo's avatar syuilo
Browse files

fix(client): 更新時にテーマキャッシュをクリアするように

parent 555954c7
No related branches found
No related tags found
No related merge requests found
...@@ -14,6 +14,9 @@ ...@@ -14,6 +14,9 @@
- Docker: Node.jsを16.6.2に - Docker: Node.jsを16.6.2に
- 依存関係の更新 - 依存関係の更新
### Bugfixes
- Misskey更新時、テーマキャッシュの影響でスタイルがおかしくなる問題を修正
## 12.86.0 (2021/08/11) ## 12.86.0 (2021/08/11)
### Improvements ### Improvements
......
...@@ -16,7 +16,7 @@ import { router } from '@client/router'; ...@@ -16,7 +16,7 @@ import { router } from '@client/router';
import { applyTheme } from '@client/scripts/theme'; import { applyTheme } from '@client/scripts/theme';
import { isDeviceDarkmode } from '@client/scripts/is-device-darkmode'; import { isDeviceDarkmode } from '@client/scripts/is-device-darkmode';
import { i18n } from '@client/i18n'; 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 * as sound from '@client/scripts/sound';
import { $i, refreshAccount, login, updateAccount, signout } from '@client/account'; import { $i, refreshAccount, login, updateAccount, signout } from '@client/account';
import { defaultStore, ColdDeviceStorage } from '@client/store'; import { defaultStore, ColdDeviceStorage } from '@client/store';
...@@ -198,6 +198,19 @@ if (splash) { ...@@ -198,6 +198,19 @@ if (splash) {
splash.style.pointerEvents = 'none'; 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) => { watch(defaultStore.reactiveState.darkMode, (darkMode) => {
applyTheme(darkMode ? ColdDeviceStorage.get('darkTheme') : ColdDeviceStorage.get('lightTheme')); applyTheme(darkMode ? ColdDeviceStorage.get('darkTheme') : ColdDeviceStorage.get('lightTheme'));
}, { immediate: localStorage.theme == null }); }, { immediate: localStorage.theme == null });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment