Skip to content

Commit 346b662

Browse files
authored
Don't show AbortErrors on logout (#29639) (#29667)
Backport #29639. When logging out of Gitea, a error toast can be seen for a split second. I don't know why or how it happens but I found it it's an `AbortError` (related to [AbortController#abort](https://developer.mozilla.org/en-US/docs/Web/API/AbortController/abort)), so let's hide it.
1 parent 25b0c99 commit 346b662

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

web_src/js/features/common-global.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,11 @@ async function fetchActionDoRequest(actionElem, url, opt) {
101101
showErrorToast(`server error: ${resp.status}`);
102102
}
103103
} catch (e) {
104-
console.error('error when doRequest', e);
105104
actionElem.classList.remove('is-loading', 'small-loading-icon');
106-
showErrorToast(i18n.network_error);
105+
if (e.name !== 'AbortError') {
106+
console.error('error when doRequest', e);
107+
showErrorToast(i18n.network_error);
108+
}
107109
}
108110
}
109111

0 commit comments

Comments
 (0)