Skip to content

Commit 72f63b8

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent e35d3c6 commit 72f63b8

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

Diff for: debug_toolbar/static/debug_toolbar/js/toolbar.js

+15-11
Original file line numberDiff line numberDiff line change
@@ -322,17 +322,21 @@ const djdt = {
322322
const origFetch = window.fetch;
323323
window.fetch = function (...args) {
324324
const promise = origFetch.apply(this, args);
325-
promise.then((response) => {
326-
if (response.headers.get("djdt-store-id") !== null) {
327-
handleAjaxResponse(response.headers.get("djdt-store-id"));
328-
}
329-
// Don't resolve the response via .json(). Instead
330-
// continue to return it to allow the caller to consume as needed.
331-
return response;
332-
}).catch((err) => {
333-
if (err.name === 'AbortError') return
334-
throw(e);
335-
});
325+
promise
326+
.then((response) => {
327+
if (response.headers.get("djdt-store-id") !== null) {
328+
handleAjaxResponse(
329+
response.headers.get("djdt-store-id")
330+
);
331+
}
332+
// Don't resolve the response via .json(). Instead
333+
// continue to return it to allow the caller to consume as needed.
334+
return response;
335+
})
336+
.catch((err) => {
337+
if (err.name === "AbortError") return;
338+
throw e;
339+
});
336340
return promise;
337341
};
338342
},

0 commit comments

Comments
 (0)