Skip to content

Commit

Permalink
fix(state builder): clone object
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroAkbal committed Sep 30, 2022
1 parent b7d8f74 commit 691adef
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion assets/js/MigrateState.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
'use strict'

import { cloneDeep } from 'lodash-es'

/**
* Migrate the state to new versions
* @param {Object} state
Expand Down Expand Up @@ -68,7 +70,7 @@ function migrateVersion0State(state) {
}

export function createStateFromStore(store) {
return {
const STATE = {
version: store.getters['getVersion'],

user: {
Expand All @@ -79,6 +81,8 @@ export function createStateFromStore(store) {
}
}
}

return cloneDeep(STATE)
}

export function restoreStateToStore(state, store) {
Expand Down

0 comments on commit 691adef

Please sign in to comment.