diff --git a/opentech/static_src/src/app/src/containers/NoteListing.js b/opentech/static_src/src/app/src/containers/NoteListing.js index eea06b58e25604fc053ac63e073d66bfb2c9522b..23eb7fc19699442759727c9f8b2f410d482ea282 100644 --- a/opentech/static_src/src/app/src/containers/NoteListing.js +++ b/opentech/static_src/src/app/src/containers/NoteListing.js @@ -19,13 +19,17 @@ import { const NoteListing = ({loadNotes, submissionID, noteIDs, isErrored, errorMessage, isLoading }) => { const fetchNotes = () => loadNotes(submissionID) + const {start, stop } = useInterval(fetchNotes, 30000) + useEffect( () => { if ( submissionID ) { fetchNotes() + start() + } else { + stop() } }, [submissionID]) - useInterval(fetchNotes, 30000) const handleRetry = () => { if (!isLoading || isErrored) {