From de6ee91d9636300d3cc8be5db490ce27a2e0b24e Mon Sep 17 00:00:00 2001 From: Saumya Pandey Date: Thu, 19 Nov 2020 08:39:08 +0530 Subject: [PATCH] fix: Prevent API request for views data for deleted documents (#1663) * Prevent API request for views data for deleted documents Added a conditional statement to check if the document.deletedAt is falsy before making a request to views.list. * Update app/components/Collaborators.js to use isDeleted attribute. Co-authored-by: Tom Moor --- app/components/Collaborators.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/components/Collaborators.js b/app/components/Collaborators.js index f632e8f63..2292f45fd 100644 --- a/app/components/Collaborators.js +++ b/app/components/Collaborators.js @@ -20,7 +20,9 @@ type Props = { @observer class Collaborators extends React.Component { componentDidMount() { - this.props.views.fetchPage({ documentId: this.props.document.id }); + if (!this.props.document.isDeleted) { + this.props.views.fetchPage({ documentId: this.props.document.id }); + } } render() {