Skip to content

Commit 886e90a

Browse files
authored
Don't show AbortErrors on logout (#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 114bb50 commit 886e90a

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
@@ -105,8 +105,10 @@ async function fetchActionDoRequest(actionElem, url, opt) {
105105
showErrorToast(`server error: ${resp.status}`);
106106
}
107107
} catch (e) {
108-
console.error('error when doRequest', e);
109-
showErrorToast(`${i18n.network_error} ${e}`);
108+
if (e.name !== 'AbortError') {
109+
console.error('error when doRequest', e);
110+
showErrorToast(`${i18n.network_error} ${e}`);
111+
}
110112
}
111113
actionElem.classList.remove('is-loading', 'small-loading-icon');
112114
}

0 commit comments

Comments
 (0)