if there is no available translation, do not show error.whatever in the UI

This commit is contained in:
Riley Davis
2017-04-26 11:43:34 -06:00
parent 80f695e23d
commit ccc512cddd
+7 -1
View File
@@ -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));
});
};