From 2472941159fdc1a6031f11bb08f3fd1a2f4d66c6 Mon Sep 17 00:00:00 2001 From: Brezo Cordero <8002881+brezocordero@users.noreply.github.com> Date: Mon, 8 Jan 2024 17:28:00 -0600 Subject: [PATCH] Do not display sender domain notice if invalid email To avoid stacking warnings. [MAILPOET-5782] --- .../assets/js/src/newsletters/send/sender-address-field.jsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mailpoet/assets/js/src/newsletters/send/sender-address-field.jsx b/mailpoet/assets/js/src/newsletters/send/sender-address-field.jsx index 4fd78c6629..5d90841e62 100644 --- a/mailpoet/assets/js/src/newsletters/send/sender-address-field.jsx +++ b/mailpoet/assets/js/src/newsletters/send/sender-address-field.jsx @@ -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() {