Skip to content

Commit

Permalink
properly aborts on unmount
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobsfletch committed Oct 3, 2024
1 parent cf61776 commit 08bd461
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions packages/ui/src/providers/DocumentInfo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -582,10 +582,6 @@ const DocumentInfo: React.FC<

void getInitialState()
}

return () => {
abortController.abort()
}
}, [
api,
operation,
Expand All @@ -602,6 +598,16 @@ const DocumentInfo: React.FC<
user,
])

useEffect(() => {
const currentAbortController = abortControllerRef.current

return () => {
if (currentAbortController) {
currentAbortController.abort()
}
}
}, [])

useEffect(() => {
void getVersions()
}, [getVersions])
Expand Down

0 comments on commit 08bd461

Please sign in to comment.