@very-simple/ajax 0.5.2 → 0.5.3
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/dist/index.js +3 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -12,7 +12,7 @@ var currentLoadController;
|
|
|
12
12
|
var load = async (url, regionIds, options) => {
|
|
13
13
|
let progressDelayTimeout;
|
|
14
14
|
try {
|
|
15
|
-
currentLoadController?.abort(
|
|
15
|
+
currentLoadController?.abort();
|
|
16
16
|
currentLoadController = new AbortController();
|
|
17
17
|
setProgress(0);
|
|
18
18
|
progressDelayTimeout = window.setTimeout(
|
|
@@ -60,7 +60,8 @@ var load = async (url, regionIds, options) => {
|
|
|
60
60
|
return parser.parseFromString(html, "text/html");
|
|
61
61
|
} catch (e) {
|
|
62
62
|
setProgress(0);
|
|
63
|
-
|
|
63
|
+
const isAbortError = e instanceof DOMException && e.name === "AbortError";
|
|
64
|
+
if (!isAbortError) {
|
|
64
65
|
window.location.reload();
|
|
65
66
|
}
|
|
66
67
|
} finally {
|