mirror of
https://github.com/fluencelabs/dweb-transports
synced 2025-03-15 18:30:49 +00:00
Fixed bug in httpfetch if set count=0
This commit is contained in:
parent
b010189f0b
commit
209c4456e2
@ -34,6 +34,7 @@ async function loopfetch(req, ms, count, what) {
|
||||
*/
|
||||
let lasterr;
|
||||
let loopguard = (typeof window != "undefined") && window.loopguard; // Optional global parameter, will cancel any loops if changes
|
||||
count = count || 1; // count of 0 actually means 1
|
||||
while (count-- && (loopguard === ((typeof window != "undefined") && window.loopguard)) ) {
|
||||
try {
|
||||
return await fetch(req);
|
||||
|
Loading…
x
Reference in New Issue
Block a user