diff --git a/app/stores/DocumentsStore.js b/app/stores/DocumentsStore.js index 41bdb1cf7..d1b19ef56 100644 --- a/app/stores/DocumentsStore.js +++ b/app/stores/DocumentsStore.js @@ -500,6 +500,13 @@ export default class DocumentsStore extends BaseStore { this.recentlyViewedIds = without(this.recentlyViewedIds, document.id); }); + // check to see if we have any shares related to this document already + // loaded in local state. If so we can go ahead and remove those too. + const share = this.rootStore.shares.getByDocumentId(document.id); + if (share) { + this.rootStore.shares.remove(share.id); + } + const collection = this.getCollectionForDocument(document); if (collection) collection.refresh(); }