Skip to content
Snippets Groups Projects
Commit 12e29b94 authored by Todd Dembrey's avatar Todd Dembrey
Browse files

GH-877: control when the polling is operational

parent 322aba4c
No related branches found
No related tags found
No related merge requests found
......@@ -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) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment