before store
This commit is contained in:
@@ -54,8 +54,6 @@ export const useSettingsStore = defineStore('settings', () => {
|
||||
console.error('Quasar Error load locale:', quasarLang, e)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
const detectLocale = (): string => {
|
||||
const localeMap = {
|
||||
@@ -113,10 +111,10 @@ export const useSettingsStore = defineStore('settings', () => {
|
||||
|
||||
const init = async () => {
|
||||
try {
|
||||
const response = await api.get('/settings')
|
||||
const { data } = await api.get('/settings')
|
||||
settings.value = {
|
||||
fontSize: response.data.data.settings.fontSize || defaultSettings.fontSize,
|
||||
locale: response.data.data.settings.locale || detectLocale()
|
||||
fontSize: data.data.settings.fontSize || defaultSettings.fontSize,
|
||||
locale: data.data.settings.locale || detectLocale()
|
||||
}
|
||||
} catch {
|
||||
settings.value.locale = detectLocale()
|
||||
|
||||
Reference in New Issue
Block a user