fix user_locale and favicon

This commit is contained in:
les
2019-09-19 16:23:46 +02:00
parent f08273aa10
commit 3a59b54a79
6 changed files with 38 additions and 21 deletions

View File

@@ -132,6 +132,9 @@ export const mutations = {
},
setLocale (state, locale) {
state.locale = locale
},
setUserLocale (state, user_locale) {
state.user_locale = user_locale
}
}
@@ -139,13 +142,11 @@ export const actions = {
// this method is called server side only for each request
// we use it to get configuration from db, setting locale, etc...
async nuxtServerInit ({ commit }, { app, store, req }) {
// TOFIX: check if we could retrieve it directly?
const settings = await app.$axios.$get('/settings')
commit('setSettings', settings)
// check if we could retrieve it directly?
const user_locale = await app.$axios.$get('/settings/user_locale')
if (user_locale[store.state.locale]) { store.commit('setUserLocale', user_locale[store.state.locale]) }
// apply settings
commit('showRecurrentEvents', settings.allow_recurrent_event && settings.recurrent_event_visible)
},