Sfoglia il codice sorgente

test and defer call to rejectResponse

Gildas 7 anni fa
parent
commit
9e031b2f20
1 ha cambiato i file con 3 aggiunte e 1 eliminazioni
  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();