fix: bring local and remote delete inline

This commit is contained in:
Tom Moor 2019-06-26 22:18:18 -07:00
parent ce675a7fe2
commit 5a6b9caabc
2 changed files with 1 additions and 3 deletions

View File

@ -100,7 +100,6 @@ export default class CollectionsStore extends BaseStore<Collection> {
delete(collection: Collection) {
super.delete(collection);
this.rootStore.documents.removeCollectionDocuments(collection.id);
this.rootStore.documents.fetchRecentlyUpdated();
this.rootStore.documents.fetchRecentlyViewed();
}

View File

@ -360,8 +360,7 @@ export default class DocumentsStore extends BaseStore<Document> {
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