Skip to content

Commit

Permalink
fix: Prevent API request for views (outline#2193)
Browse files Browse the repository at this point in the history
  • Loading branch information
iamsaumya authored Jun 8, 2021
1 parent b4c08a0 commit ffed38b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/components/DocumentViews.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ function DocumentViews({ document, isOpen }: Props) {
const { views, presence } = useStores();

React.useEffect(() => {
views.fetchPage({ documentId: document.id });
}, [views, document.id]);
if (!document.isDeleted) {
views.fetchPage({ documentId: document.id });
}
}, [views, document.id, document.isDeleted]);

let documentPresence = presence.get(document.id);
documentPresence = documentPresence
Expand Down

0 comments on commit ffed38b

Please sign in to comment.