Do not display sender domain notice if invalid email

To avoid stacking warnings.

[MAILPOET-5782]
This commit is contained in:
Brezo Cordero
2024-01-08 17:28:00 -06:00
committed by Aschepikov
parent cfb3304186
commit 2472941159

View File

@@ -80,12 +80,16 @@ class SenderField extends Component {
if (!isFieldValid(this.domElementSelector)) {
validateField(this.domElementSelector);
// Hide domain error to not stack error messages
this.showSenderDomainError(false);
return;
}
if (!emailAddressIsAuthorized) {
this.showInvalidFromAddressError(emailAddress);
return;
}
this.showSenderDomainError(true);
};
showSenderDomainError = (status) => {
@@ -115,8 +119,6 @@ class SenderField extends Component {
isPartiallyVerifiedDomain:
window.mailpoet_partially_verified_sender_domains.includes(emailDomain),
});
this.showSenderDomainError(true, emailAddress);
}
render() {