Commit 76dcbd0b authored by Mohammad Nakhaee's avatar Mohammad Nakhaee
Browse files

place the conditional statement where fetchData() is called

move it out from the definition
parent a81fd4a7
Pipeline #112708 passed with stages
in 29 minutes and 17 seconds
......@@ -186,14 +186,14 @@ export default function FilesBrower({uploadId, disabled}) {
})
setRenderCounter(renderCounter => renderCounter + 1)
}
if (!disabled) {
fetchData().catch(errors.raiseError)
}
fetchData().catch(errors.raiseError)
}, [uploadId, api, errors, setRenderCounter])
useEffect(() => {
fetchData('')
}, [fetchData])
if (!disabled) {
fetchData('')
}
}, [fetchData, disabled])
const handleToggle = (path) => {
const folderData = allData.current[path]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment