Skip to content

Commit

Permalink
fix: devモードの特定条件下でページが表示されなくなる問題を修正 (#12653)
Browse files Browse the repository at this point in the history
* fix: devモードでキャッシュクリアするとページが表示されなくなる問題を修正

* fix: localeがnullの場合も最新のlocaleを取得するように
  • Loading branch information
hideki0403 authored Dec 14, 2023
1 parent 386fced commit 239507d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/frontend/src/boot/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { compareVersions } from 'compare-versions';
import widgets from '@/widgets/index.js';
import directives from '@/directives/index.js';
import components from '@/components/index.js';
import { version, ui, lang, updateLocale } from '@/config.js';
import { version, ui, lang, updateLocale, locale } from '@/config.js';
import { applyTheme } from '@/scripts/theme.js';
import { isDeviceDarkmode } from '@/scripts/is-device-darkmode.js';
import { i18n, updateI18n } from '@/i18n.js';
Expand Down Expand Up @@ -88,7 +88,7 @@ export async function common(createVue: () => App<Element>) {

//#region Detect language & fetch translations
const localeVersion = miLocalStorage.getItem('localeVersion');
const localeOutdated = (localeVersion == null || localeVersion !== version);
const localeOutdated = (localeVersion == null || localeVersion !== version || locale == null);
if (localeOutdated) {
const res = await window.fetch(`/assets/locales/${lang}.${version}.json`);
if (res.status === 200) {
Expand Down
1 change: 1 addition & 0 deletions packages/frontend/src/scripts/clear-cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { fetchCustomEmojis } from '@/custom-emojis.js';
export async function clearCache() {
os.waiting();
miLocalStorage.removeItem('locale');
miLocalStorage.removeItem('localeVersion');
miLocalStorage.removeItem('theme');
miLocalStorage.removeItem('emojis');
miLocalStorage.removeItem('lastEmojisFetchedAt');
Expand Down

0 comments on commit 239507d

Please sign in to comment.