From 5a6b9caabce8589d728cb05d436b0b2976fb45fb Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Wed, 26 Jun 2019 22:18:18 -0700 Subject: [PATCH] fix: bring local and remote delete inline --- app/stores/CollectionsStore.js | 1 - app/stores/DocumentsStore.js | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/app/stores/CollectionsStore.js b/app/stores/CollectionsStore.js index fa518f1e2..a3aa105ff 100644 --- a/app/stores/CollectionsStore.js +++ b/app/stores/CollectionsStore.js @@ -100,7 +100,6 @@ export default class CollectionsStore extends BaseStore { delete(collection: Collection) { super.delete(collection); - this.rootStore.documents.removeCollectionDocuments(collection.id); this.rootStore.documents.fetchRecentlyUpdated(); this.rootStore.documents.fetchRecentlyViewed(); } diff --git a/app/stores/DocumentsStore.js b/app/stores/DocumentsStore.js index 76c3fe295..34c3fdf8b 100644 --- a/app/stores/DocumentsStore.js +++ b/app/stores/DocumentsStore.js @@ -360,8 +360,7 @@ export default class DocumentsStore extends BaseStore { removeCollectionDocuments(collectionId: string) { const documents = this.inCollection(collectionId); const documentIds = documents.map(doc => doc.id); - this.recentlyViewedIds = without(this.recentlyViewedIds, ...documentIds); - documentIds.forEach(id => this.data.delete(id)); + documentIds.forEach(id => this.remove(id)); } @action