diff options
| author | usodhi <61431818+usodhi@users.noreply.github.com> | 2021-02-25 15:36:49 -0500 |
|---|---|---|
| committer | usodhi <61431818+usodhi@users.noreply.github.com> | 2021-02-25 15:36:49 -0500 |
| commit | 95451a2eb0871856b946fff8a14ca0c385af5f1b (patch) | |
| tree | 90c18c68c4e077d63dd3286d527b243ac6cdc501 /src/client/views/collections/CollectionView.tsx | |
| parent | 02bceed486ecb03b94c757ae669f69912f282cdd (diff) | |
| parent | 17ee7f6f1f61a079ec79b71aebc65abfd72ec32a (diff) | |
merging
Diffstat (limited to 'src/client/views/collections/CollectionView.tsx')
| -rw-r--r-- | src/client/views/collections/CollectionView.tsx | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/src/client/views/collections/CollectionView.tsx b/src/client/views/collections/CollectionView.tsx index 9ae469930..f305174f1 100644 --- a/src/client/views/collections/CollectionView.tsx +++ b/src/client/views/collections/CollectionView.tsx @@ -211,14 +211,7 @@ export class CollectionView extends Touchable<CollectionViewProps> { } const first = doc instanceof Doc ? doc : doc[0]; if (!first?._stayInCollection && addDocument !== returnFalse) { - if (UndoManager.RunInTempBatch(() => this.removeDocument(doc))) { - const added = addDocument(doc); - if (!added) UndoManager.UndoTempBatch(); - else UndoManager.ClearTempBatch(); - - return added; - } - UndoManager.ClearTempBatch(); + return UndoManager.RunInTempBatch(() => this.removeDocument(doc) && addDocument(doc)); } return false; } |
