Sync app settings at login/registration instead of page load

This commit is contained in:
Bubka
2025-02-26 18:32:20 +01:00
parent 4ef76e0ae9
commit f3945463b7
11 changed files with 71 additions and 40 deletions

View File

@ -1,5 +1,4 @@
import appSettingService from '@/services/appSettingService'
import { useAppSettingsStore } from '@/stores/appSettings'
import { useNotifyStore } from '@/stores/notify'
/**
@ -9,13 +8,11 @@ import { useNotifyStore } from '@/stores/notify'
*/
export async function useAppSettingsUpdater(setting, value, returnValidationError = false) {
// const appSettings = useAppSettingsStore()
let data = null
let error = null
await appSettingService.update(setting, value, { returnError: true })
.then(response => {
// appSettings[setting] = value
data = value
useNotifyStore().success({ type: 'is-success', text: trans('settings.forms.setting_saved') })
})