fix: last preferences did not clone correctly

This commit is contained in:
tiny-craft 2023-10-27 13:01:18 +08:00
parent 85ab6e4377
commit 33051f4e46
1 changed files with 2 additions and 2 deletions

View File

@ -1,6 +1,6 @@
import { defineStore } from 'pinia' import { defineStore } from 'pinia'
import { lang } from '@/langs/index.js' import { lang } from '@/langs/index.js'
import { clone, find, get, isEmpty, map, pick, set, split } from 'lodash' import { cloneDeep, find, get, isEmpty, map, pick, set, split } from 'lodash'
import { import {
CheckForUpdate, CheckForUpdate,
GetFontList, GetFontList,
@ -178,7 +178,7 @@ const usePreferencesStore = defineStore('preferences', {
async loadPreferences() { async loadPreferences() {
const { success, data } = await GetPreferences() const { success, data } = await GetPreferences()
if (success) { if (success) {
this.lastPref = clone(data) this.lastPref = cloneDeep(data)
this._applyPreferences(data) this._applyPreferences(data)
i18nGlobal.locale.value = this.currentLanguage i18nGlobal.locale.value = this.currentLanguage
} }