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:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user