prevent the setTimeout from being called after a download has been stopped

This commit is contained in:
Akinwale Ariwodola 2018-10-22 11:20:30 +01:00
parent b600cbdc34
commit 5351226d44

View file

@ -29,7 +29,11 @@ export function doUpdateLoadStatus(uri, outpoint) {
outpoint,
full_status: true,
}).then(([fileInfo]) => {
if (!fileInfo || fileInfo.written_bytes === 0) {
if (!fileInfo) {
return;
}
if (fileInfo && fileInfo.written_bytes === 0) {
// download hasn't started yet
setTimeout(() => {
dispatch(doUpdateLoadStatus(uri, outpoint));