Skip to content

Commit 40ec9a7

Browse files
committed
remove unnecessary error checks
1 parent fd6b7ea commit 40ec9a7

File tree

1 file changed

+0
-12
lines changed
  • contentcuration/contentcuration/frontend/shared

1 file changed

+0
-12
lines changed

contentcuration/contentcuration/frontend/shared/client.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,26 +38,17 @@ window.addEventListener('offline', () => {
3838
lastOffline = Date.now();
3939
});
4040

41-
// Track page state
42-
let isNavigating = false;
4341
const pendingRequests = new Set();
4442

4543
// Create an AbortController for managing pending requests
4644
const abortController = new AbortController();
4745

4846
window.addEventListener('navigate', () => {
49-
isNavigating = true;
50-
5147
// Create a fresh AbortController to ensure proper cancellation of requests
5248
// for each navigation and prevent interference from previous aborts.
5349
const newAbortController = new AbortController();
5450
abortController.signal = newAbortController.signal;
5551

56-
// Listen for the abort event to reset the navigation flag
57-
newAbortController.signal.addEventListener('abort', () => {
58-
isNavigating = false;
59-
});
60-
6152
// Abort pending requests when navigation begins
6253
abortController.abort();
6354
});
@@ -88,10 +79,7 @@ client.interceptors.response.use(
8879

8980
// Ignore specific types of errors
9081
if (
91-
isNavigating ||
9282
isCancel(error) ||
93-
error.code === 'ERR_CANCELED' ||
94-
error.code === 'ECONNABORTED' ||
9583
(error.response && [302, 403, 404, 405, 412].includes(error.response.status)) // added 302
9684
) {
9785
return Promise.reject(error);

0 commit comments

Comments
 (0)