mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-08-09 13:55:01 +02:00
Sync app settings at login/registration instead of page load
This commit is contained in:
@ -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') })
|
||||
})
|
||||
|
Reference in New Issue
Block a user