From de7cbb376e8907c93d2792c7fa5b9b032b734aa2 Mon Sep 17 00:00:00 2001 From: syuilo <4439005+syuilo@users.noreply.github.com> Date: Wed, 26 Nov 2025 19:26:27 +0900 Subject: fix(frontend): 初回読み込み時にエラーになることがある問題を修正 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix #16562 --- packages/frontend/src/boot/common.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'packages/frontend/src/boot/common.ts') diff --git a/packages/frontend/src/boot/common.ts b/packages/frontend/src/boot/common.ts index 355ef01c83..71fd9bb54a 100644 --- a/packages/frontend/src/boot/common.ts +++ b/packages/frontend/src/boot/common.ts @@ -153,8 +153,15 @@ export async function common(createVue: () => Promise>) { }); //#endregion + if (!isSafeMode) { + // TODO: instance.defaultLightTheme/instance.defaultDarkThemeが不正な形式だった場合のケア + if (prefer.s.lightTheme == null && instance.defaultLightTheme != null) prefer.commit('lightTheme', JSON.parse(instance.defaultLightTheme)); + if (prefer.s.darkTheme == null && instance.defaultDarkTheme != null) prefer.commit('darkTheme', JSON.parse(instance.defaultDarkTheme)); + } + // NOTE: この処理は必ずクライアント更新チェック処理より後に来ること(テーマ再構築のため) // NOTE: この処理は必ずダークモード判定処理より後に来ること(初回のテーマ適用のため) + // NOTE: この処理は必ずサーバーテーマ適用処理より後に来ること(二重applyTheme発火を防ぐため) // see: https://github.com/misskey-dev/misskey/issues/16562 watch(store.r.darkMode, (darkMode) => { const theme = (() => { @@ -185,12 +192,6 @@ export async function common(createVue: () => Promise>) { applyTheme(theme ?? defaultLightTheme); } }); - - fetchInstanceMetaPromise.then(() => { - // TODO: instance.defaultLightTheme/instance.defaultDarkThemeが不正な形式だった場合のケア - if (prefer.s.lightTheme == null && instance.defaultLightTheme != null) prefer.commit('lightTheme', JSON.parse(instance.defaultLightTheme)); - if (prefer.s.darkTheme == null && instance.defaultDarkTheme != null) prefer.commit('darkTheme', JSON.parse(instance.defaultDarkTheme)); - }); } watch(prefer.r.overridedDeviceKind, (kind) => { -- cgit v1.2.3-freya