aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionView.tsx
diff options
context:
space:
mode:
authorusodhi <61431818+usodhi@users.noreply.github.com>2021-02-25 15:36:49 -0500
committerusodhi <61431818+usodhi@users.noreply.github.com>2021-02-25 15:36:49 -0500
commit95451a2eb0871856b946fff8a14ca0c385af5f1b (patch)
tree90c18c68c4e077d63dd3286d527b243ac6cdc501 /src/client/views/collections/CollectionView.tsx
parent02bceed486ecb03b94c757ae669f69912f282cdd (diff)
parent17ee7f6f1f61a079ec79b71aebc65abfd72ec32a (diff)
merging
Diffstat (limited to 'src/client/views/collections/CollectionView.tsx')
-rw-r--r--src/client/views/collections/CollectionView.tsx9
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;
}