Procházet zdrojové kódy

test and defer call to rejectResponse

Gildas před 7 roky
rodič
revize
9e031b2f20
1 změnil soubory, kde provedl 3 přidání a 1 odebrání
  1. 3 1
      lib/fetch/content/fetch.js

+ 3 - 1
lib/fetch/content/fetch.js

@@ -57,7 +57,9 @@ this.superFetch = this.superFetch || (() => {
 			};
 			xhrRequest.onerror = error => {
 				reject(error);
-				rejectResponse(error);
+				if (rejectResponse) {
+					setTimeout(() => rejectResponse(error), 1);
+				}
 			};
 			xhrRequest.open("GET", url, true);
 			xhrRequest.send();