@firebase/storage 0.8.6 → 0.8.7-20211010221442
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/index.browser.cjs.js +18 -7
- package/dist/index.browser.cjs.js.map +1 -1
- package/dist/index.esm2017.js +18 -7
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +18 -7
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +18 -7
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/node-esm/index.node.esm.js +18 -7
- package/dist/node-esm/index.node.esm.js.map +1 -1
- package/package.json +2 -2
|
@@ -337,7 +337,9 @@ callback, timeout) {
|
|
|
337
337
|
// Would type this as "number" but that doesn't work for Node so ¯\_(ツ)_/¯
|
|
338
338
|
// TODO: find a way to exclude Node type definition for storage because storage only works in browser
|
|
339
339
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
340
|
-
let
|
|
340
|
+
let retryTimeoutId = null;
|
|
341
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
342
|
+
let globalTimeoutId = null;
|
|
341
343
|
let hitTimeout = false;
|
|
342
344
|
let cancelState = 0;
|
|
343
345
|
function canceled() {
|
|
@@ -351,21 +353,29 @@ callback, timeout) {
|
|
|
351
353
|
}
|
|
352
354
|
}
|
|
353
355
|
function callWithDelay(millis) {
|
|
354
|
-
|
|
355
|
-
|
|
356
|
+
retryTimeoutId = setTimeout(() => {
|
|
357
|
+
retryTimeoutId = null;
|
|
356
358
|
f(handler, canceled());
|
|
357
359
|
}, millis);
|
|
358
360
|
}
|
|
361
|
+
function clearGlobalTimeout() {
|
|
362
|
+
if (globalTimeoutId) {
|
|
363
|
+
clearTimeout(globalTimeoutId);
|
|
364
|
+
}
|
|
365
|
+
}
|
|
359
366
|
function handler(success, ...args) {
|
|
360
367
|
if (triggeredCallback) {
|
|
368
|
+
clearGlobalTimeout();
|
|
361
369
|
return;
|
|
362
370
|
}
|
|
363
371
|
if (success) {
|
|
372
|
+
clearGlobalTimeout();
|
|
364
373
|
triggerCallback.call(null, success, ...args);
|
|
365
374
|
return;
|
|
366
375
|
}
|
|
367
376
|
const mustStop = canceled() || hitTimeout;
|
|
368
377
|
if (mustStop) {
|
|
378
|
+
clearGlobalTimeout();
|
|
369
379
|
triggerCallback.call(null, success, ...args);
|
|
370
380
|
return;
|
|
371
381
|
}
|
|
@@ -389,14 +399,15 @@ callback, timeout) {
|
|
|
389
399
|
return;
|
|
390
400
|
}
|
|
391
401
|
stopped = true;
|
|
402
|
+
clearGlobalTimeout();
|
|
392
403
|
if (triggeredCallback) {
|
|
393
404
|
return;
|
|
394
405
|
}
|
|
395
|
-
if (
|
|
406
|
+
if (retryTimeoutId !== null) {
|
|
396
407
|
if (!wasTimeout) {
|
|
397
408
|
cancelState = 2;
|
|
398
409
|
}
|
|
399
|
-
clearTimeout(
|
|
410
|
+
clearTimeout(retryTimeoutId);
|
|
400
411
|
callWithDelay(0);
|
|
401
412
|
}
|
|
402
413
|
else {
|
|
@@ -406,7 +417,7 @@ callback, timeout) {
|
|
|
406
417
|
}
|
|
407
418
|
}
|
|
408
419
|
callWithDelay(0);
|
|
409
|
-
setTimeout(() => {
|
|
420
|
+
globalTimeoutId = setTimeout(() => {
|
|
410
421
|
hitTimeout = true;
|
|
411
422
|
stop(true);
|
|
412
423
|
}, timeout);
|
|
@@ -3114,7 +3125,7 @@ class FirebaseStorageImpl {
|
|
|
3114
3125
|
}
|
|
3115
3126
|
|
|
3116
3127
|
const name = "@firebase/storage";
|
|
3117
|
-
const version = "0.8.
|
|
3128
|
+
const version = "0.8.7-20211010221442";
|
|
3118
3129
|
|
|
3119
3130
|
/**
|
|
3120
3131
|
* @license
|