fix: Remove collections/document when removed elsewhere

This commit is contained in:
Tom Moor
2019-06-26 22:10:24 -07:00
parent 3d7eb11a49
commit ce675a7fe2
3 changed files with 31 additions and 9 deletions

View File

@ -1,5 +1,5 @@
// @flow
import { computed, runInAction } from 'mobx';
import { computed } from 'mobx';
import { concat, filter, last } from 'lodash';
import { client } from 'utils/ApiClient';
@ -100,10 +100,9 @@ export default class CollectionsStore extends BaseStore<Collection> {
delete(collection: Collection) {
super.delete(collection);
runInAction(() => {
this.rootStore.documents.fetchRecentlyUpdated();
this.rootStore.documents.fetchRecentlyViewed();
});
this.rootStore.documents.removeCollectionDocuments(collection.id);
this.rootStore.documents.fetchRecentlyUpdated();
this.rootStore.documents.fetchRecentlyViewed();
}
export = () => {