chore: use klona to clone project objet
This commit is contained in:
parent
d85be26761
commit
55e912221b
@ -1,6 +1,7 @@
|
|||||||
import {watch, reactive, shallowReactive, unref, toRefs, readonly, ref, computed} from 'vue'
|
import {watch, reactive, shallowReactive, unref, toRefs, readonly, ref, computed} from 'vue'
|
||||||
import {acceptHMRUpdate, defineStore} from 'pinia'
|
import {acceptHMRUpdate, defineStore} from 'pinia'
|
||||||
import {useI18n} from 'vue-i18n'
|
import {useI18n} from 'vue-i18n'
|
||||||
|
import {klona} from 'klona/lite'
|
||||||
|
|
||||||
import ProjectService from '@/services/project'
|
import ProjectService from '@/services/project'
|
||||||
import {setModuleLoading} from '@/stores/helper'
|
import {setModuleLoading} from '@/stores/helper'
|
||||||
@ -144,9 +145,7 @@ export const useProjectStore = defineStore('project', () => {
|
|||||||
|
|
||||||
// the returned project from projectService.update is the same!
|
// the returned project from projectService.update is the same!
|
||||||
// in order to not create a manipulation in pinia store we have to create a new copy
|
// in order to not create a manipulation in pinia store we have to create a new copy
|
||||||
return {
|
return klona(project)
|
||||||
...project,
|
|
||||||
}
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// Reset the project state to the initial one to avoid confusion for the user
|
// Reset the project state to the initial one to avoid confusion for the user
|
||||||
setProject({
|
setProject({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user