fix: ui color theme wrong selection #332

This commit is contained in:
sedum 2024-01-17 19:16:14 +01:00
parent 80ffb5932b
commit 841e2b69c0

View file

@ -4,6 +4,9 @@ import { ca, cs, de, en, es, eu, fr, gl, it, nb, nl, pl, pt, tr, sk, ro, ru, zhH
export default ({ res, nuxtState }) => {
const settings = process.server ? (res.locals.settings || {}) : nuxtState.state.settings || {}
const is_dark = process.client
? (typeof nuxtState.state.localSettings['theme.is_dark'] !== 'undefined' ? nuxtState.state.localSettings['theme.is_dark'] : settings['theme.is_dark'])
: settings['theme.is_dark']
return {
lang: { locales: { ca, cs, de, en, es, eu, fr, gl, it, nb, nl, pl, pt, sk, tr, ro, ru, zhHans } },
@ -14,7 +17,7 @@ export default ({ res, nuxtState }) => {
variations: false,
minifyTheme,
},
dark: settings['theme.is_dark'],
dark: is_dark,
themes: {
dark: settings.dark_colors,
light: settings.light_colors