fix: show the error message received from the server when sending test email fails (#11972)

This commit is contained in:
akash-codemonk 2022-03-24 16:50:43 +05:30 committed by GitHub
parent a486474483
commit 7443c16e59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -110,6 +110,9 @@ function* SendTestEmail(action: ReduxAction<SendTestEmailPayload>) {
try { try {
const response = yield call(UserApi.sendTestEmail, action.payload); const response = yield call(UserApi.sendTestEmail, action.payload);
const currentUser = yield select(getCurrentUser); const currentUser = yield select(getCurrentUser);
const isValidResponse = yield validateResponse(response);
if (isValidResponse) {
let actionElement; let actionElement;
if (response.data) { if (response.data) {
actionElement = ( actionElement = (
@ -131,13 +134,8 @@ function* SendTestEmail(action: ReduxAction<SendTestEmailPayload>) {
hideProgressBar: true, hideProgressBar: true,
variant: response.data ? Variant.info : Variant.danger, variant: response.data ? Variant.info : Variant.danger,
}); });
} catch (e) {
Toaster.show({
text: e?.message || createMessage(TEST_EMAIL_FAILURE),
hideProgressBar: true,
variant: Variant.danger,
});
} }
} catch (e) {}
} }
function* InitSuperUserSaga(action: ReduxAction<User>) { function* InitSuperUserSaga(action: ReduxAction<User>) {