Fix registration pending translation bug (#2393)

This commit is contained in:
SleeplessOne1917 2024-03-22 18:29:22 -04:00 committed by GitHub
parent a860bdd700
commit 610789242b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -77,7 +77,15 @@ async function handleLoginSubmit(i: Login, event: any) {
if (loginRes.err.message === "missing_totp_token") { if (loginRes.err.message === "missing_totp_token") {
i.setState({ show2faModal: true }); i.setState({ show2faModal: true });
} else { } else {
toast(I18NextService.i18n.t(loginRes.err.message), "danger"); // TODO: We shouldn't be passing error messages as args into i18next
toast(
I18NextService.i18n.t(
loginRes.err.message === "registration_application_is_pending"
? "registration_application_pending"
: loginRes.err.message,
),
"danger",
);
} }
i.setState({ loginRes }); i.setState({ loginRes });