fix(webapp): handle the too many requests error

This commit is contained in:
Ahmed Bouhuolia
2023-07-16 21:19:06 +02:00
parent 92f929152f
commit 8b0feb9022
5 changed files with 26 additions and 3 deletions

View File

@@ -9,6 +9,7 @@ import { compose } from '@/utils';
let toastKeySessionExpired;
let toastKeySomethingWrong;
let toastTooManyRequests;
function GlobalErrors({
// #withGlobalErrors
@@ -41,6 +42,18 @@ function GlobalErrors({
toastKeySomethingWrong,
);
}
if (globalErrors.too_many_requests) {
toastTooManyRequests = AppToaster.show(
{
message: intl.get('global_error.too_many_requests'),
intent: Intent.DANGER,
onDismiss: () => {
globalErrorsSet({ too_many_requests: false });
},
},
toastTooManyRequests,
);
}
if (globalErrors.access_denied) {
toastKeySomethingWrong = AppToaster.show(
{