From bde6f4b3c405a9b9420c652a52c9675e8442185b Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Mon, 30 Nov 2020 23:17:39 -0800 Subject: [PATCH] fix: Don't make request to record view for deleted document --- app/models/Document.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/models/Document.js b/app/models/Document.js index 1ec8134f9..0949d3925 100644 --- a/app/models/Document.js +++ b/app/models/Document.js @@ -206,6 +206,11 @@ export default class Document extends BaseModel { @action view = () => { + // we don't record views for documents in the trash + if (this.isDeleted) { + return; + } + return this.store.rootStore.views.create({ documentId: this.id }); };