Skip to content

Commit

Permalink
fix(state-editor): update deepSync function to handle state prop
Browse files Browse the repository at this point in the history
  • Loading branch information
arashsheyda authored Aug 23, 2024
1 parent d8dfc89 commit caab77e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions packages/devtools/client/components/StateEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ onMounted(() => {
})
function deepSync(from: any, to: any) {
for (const key in from) {
if (from[key] === null)
to[key] = null
else if (Array.isArray(from[key]))
to[key] = from[key].slice()
else if (typeof from[key] === 'object')
deepSync(from[key], to[key])
// const fromRevision = from[0]
const fromValue = from[1]
for (const key in fromValue) {
if (Array.isArray(fromValue[key]))
to[key] = fromValue[key].slice()
else if (typeof fromValue[key] === 'object')
deepSync(fromValue[key], to[key])
else
to[key] = from[key]
to[key] = fromValue[key]
}
}
Expand Down

0 comments on commit caab77e

Please sign in to comment.