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 <tom.moor@gmail.com>
This commit is contained in:
Saumya Pandey
2020-11-19 08:39:08 +05:30
committed by GitHub
parent 18fac781a9
commit de6ee91d96

View File

@@ -20,7 +20,9 @@ type Props = {
@observer
class Collaborators extends React.Component<Props> {
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() {