mirror of
https://github.com/wassname/talk.git
synced 2026-07-03 11:28:25 +08:00
if there is no available translation, do not show error.whatever in the UI
This commit is contained in:
@@ -177,7 +177,13 @@ export const fetchSignUp = (formData, redirectUri) => (dispatch) => {
|
||||
dispatch(signUpSuccess(user));
|
||||
})
|
||||
.catch(error => {
|
||||
dispatch(signUpFailure(lang.t(`error.${error.message}`)));
|
||||
let errorMessage = lang.t(`error.${error.message}`);
|
||||
|
||||
// if there is no translation defined, just show the error string
|
||||
if (errorMessage === `error.${error.message}`) {
|
||||
errorMessage = error.message;
|
||||
}
|
||||
dispatch(signUpFailure(errorMessage));
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user