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.
pull/29305/head^2
silverwind 8 months ago committed by GitHub
parent 114bb505a3
commit 886e90aa82
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 6
      web_src/js/features/common-global.js

@ -105,8 +105,10 @@ async function fetchActionDoRequest(actionElem, url, opt) {
showErrorToast(`server error: ${resp.status}`); showErrorToast(`server error: ${resp.status}`);
} }
} catch (e) { } catch (e) {
console.error('error when doRequest', e); if (e.name !== 'AbortError') {
showErrorToast(`${i18n.network_error} ${e}`); console.error('error when doRequest', e);
showErrorToast(`${i18n.network_error} ${e}`);
}
} }
actionElem.classList.remove('is-loading', 'small-loading-icon'); actionElem.classList.remove('is-loading', 'small-loading-icon');
} }

Loading…
Cancel
Save