wrong user / admin merge dark theme settings - fix #244

This commit is contained in:
lesion 2023-03-09 21:38:39 +01:00
parent b401d829db
commit d2759a55a5
No known key found for this signature in database
GPG key ID: 352918250B012177

View file

@ -41,10 +41,10 @@ export const state = () => ({
export const getters = { export const getters = {
hide_thumbs (state) { hide_thumbs (state) {
return (state.localSettings['hide_thumbs'] === null) ? state.settings.hide_thumbs : state.localSettings.hide_thumbs return (![true, false].includes(state.localSettings['hide_thumbs'])) ? state.settings.hide_thumbs : state.localSettings.hide_thumbs
}, },
is_dark (state) { is_dark (state) {
return (state.localSettings['theme.is_dark'] === null) ? state.settings['theme.is_dark'] : state.localSettings['theme.is_dark'] return (![true, false].includes(state.localSettings['theme.is_dark'])) ? state.settings['theme.is_dark'] : state.localSettings['theme.is_dark']
} }
} }
@ -73,9 +73,10 @@ export const actions = {
// this method is called server side only for each request for nuxt // this method is called server side only for each request for nuxt
// we use it to get configuration from db, set locale, etc... // we use it to get configuration from db, set locale, etc...
nuxtServerInit ({ commit }, { res, app }) { nuxtServerInit ({ commit }, { res, app }) {
console.error('dentro nuxtServerInit ', res.locals)
if (res.locals && res.locals.settings) { if (res.locals && res.locals.settings) {
commit('setSettings', res.locals.settings) commit('setSettings', res.locals.settings)
console.error(`SETTINGS: ${res.locals.settings}`)
} }
commit('setFilter', { type: 'show_recurrent', commit('setFilter', { type: 'show_recurrent',
value: res.locals.settings.allow_recurrent_event && res.locals.settings.recurrent_event_visible }) value: res.locals.settings.allow_recurrent_event && res.locals.settings.recurrent_event_visible })