mirror of
https://github.com/cudr/slate-collaborative.git
synced 2024-10-27 20:34:06 +00:00
Fix setNodes undefined value since automerge does not handle undefined value correctly. (#49)
This commit is contained in:
parent
d141da4430
commit
ef35812723
@ -9,7 +9,12 @@ const setNode = (doc: SyncValue, op: SetNodeOperation): SyncValue => {
|
|||||||
const { newProperties } = op
|
const { newProperties } = op
|
||||||
|
|
||||||
for (let key in newProperties) {
|
for (let key in newProperties) {
|
||||||
node[key] = newProperties[key]
|
const value = newProperties[key]
|
||||||
|
if (value !== undefined) {
|
||||||
|
node[key] = value
|
||||||
|
} else {
|
||||||
|
delete node[key]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return doc
|
return doc
|
||||||
|
Loading…
Reference in New Issue
Block a user