clear response if range goes back to null

I don't think this ever happens, but just in case, it'd be confusing
if the list didn't clear.
This commit is contained in:
Scott Lamb 2021-03-14 21:44:03 -07:00
parent 718a9a5dc8
commit 9d0a48ba00

View File

@ -62,13 +62,15 @@ const VideoList = ({
}
setResponse(r);
};
if (range90k != null) {
if (range90k !== null) {
doFetch(abort.signal, range90k);
const timeout = setTimeout(() => setShowLoading(true), 1000);
return () => {
abort.abort();
clearTimeout(timeout);
};
} else {
setResponse(null);
}
}, [range90k, snackbars, stream]);