diff options
author | bobzel <zzzman@gmail.com> | 2020-10-06 14:29:43 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2020-10-06 14:29:43 -0400 |
commit | 031e29b1cf14f643f3b52c52f77785e71f011708 (patch) | |
tree | 3f8d0e0927d11b9ae10b888fbf083c4b1374d0a0 /src/fields/util.ts | |
parent | e66380d8a99c3ee61faeaaebf6e28395332e1d64 (diff) |
from last
Diffstat (limited to 'src/fields/util.ts')
-rw-r--r-- | src/fields/util.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/fields/util.ts b/src/fields/util.ts index b6128f5e6..6e72675db 100644 --- a/src/fields/util.ts +++ b/src/fields/util.ts @@ -382,8 +382,8 @@ export function updateFunction(target: any, prop: any, value: any, receiver: any if (!(value instanceof CursorField) && !(value?.some?.((v: any) => v instanceof CursorField))) { UndoManager.AddEvent(diff?.op === "$addToSet" ? { - redo: () => receiver[prop].push(...(newValue as List<Doc>)), - undo: action(() => (newValue as List<Doc>).forEach(doc => { + redo: () => receiver[prop].push(...diff.items), + undo: action(() => diff.items.forEach((doc: Doc) => { const ind = receiver[prop].indexOf(doc); ind !== -1 && receiver[prop].splice(ind, 1); })) |