parent
7a82c1a912
commit
aafd8b6bf7
|
|
@ -18,6 +18,7 @@
|
|||
- ウォーターマークを敷き詰めると上下左右反転した画像/文字が表示される問題を修正
|
||||
- ウォーターマークを回転させた際に画面からはみ出た部分を考慮できるように
|
||||
- Fix: 投票が終了した後に投票結果が正しく表示されない問題を修正
|
||||
- Fix: ダークモードの同期が機能しない場合がある問題を修正
|
||||
|
||||
### Server
|
||||
- Enhance: 管理者/モデレーターはファイルのアップロード制限をバイパスするように
|
||||
|
|
|
|||
|
|
@ -176,7 +176,7 @@ export async function common(createVue: () => Promise<App<Element>>) {
|
|||
})();
|
||||
|
||||
applyTheme(theme);
|
||||
}, { immediate: isSafeMode || miLocalStorage.getItem('theme') == null });
|
||||
}, { immediate: true });
|
||||
|
||||
window.document.documentElement.dataset.colorScheme = store.s.darkMode ? 'dark' : 'light';
|
||||
|
||||
|
|
@ -195,14 +195,6 @@ export async function common(createVue: () => Promise<App<Element>>) {
|
|||
applyTheme(theme ?? defaultLightTheme);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (!isSafeMode) {
|
||||
if (prefer.s.darkTheme && store.s.darkMode) {
|
||||
if (miLocalStorage.getItem('themeId') !== prefer.s.darkTheme.id) applyTheme(prefer.s.darkTheme);
|
||||
} else if (prefer.s.lightTheme && !store.s.darkMode) {
|
||||
if (miLocalStorage.getItem('themeId') !== prefer.s.lightTheme.id) applyTheme(prefer.s.lightTheme);
|
||||
}
|
||||
|
||||
fetchInstanceMetaPromise.then(() => {
|
||||
// TODO: instance.defaultLightTheme/instance.defaultDarkThemeが不正な形式だった場合のケア
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ function applyThemeInternal(theme: Theme, persist: boolean) {
|
|||
}
|
||||
|
||||
let timeout: number | null = null;
|
||||
let currentTheme: Theme | null = null;
|
||||
let currentThemeId = miLocalStorage.getItem('themeId');
|
||||
|
||||
export function applyTheme(theme: Theme, persist = true) {
|
||||
if (timeout) {
|
||||
|
|
@ -139,9 +139,8 @@ export function applyTheme(theme: Theme, persist = true) {
|
|||
timeout = null;
|
||||
}
|
||||
|
||||
if (deepEqual(currentTheme, theme)) return;
|
||||
// リアクティビティ解除
|
||||
currentTheme = deepClone(theme);
|
||||
if (theme.id === currentThemeId) return;
|
||||
currentThemeId = theme.id;
|
||||
|
||||
if (window.document.startViewTransition != null) {
|
||||
window.document.documentElement.classList.add('_themeChanging_');
|
||||
|
|
|
|||
Loading…
Reference in New Issue