Fix render warning [MAILPOET-1873]

This commit is contained in:
Amine Ben hammou
2019-03-12 18:03:36 +01:00
committed by M. Shull
parent ddc860187e
commit b42f184b1d

View File

@@ -407,14 +407,17 @@ const MailerMixin = {
&& state.meta.mta_log.error.operation !== 'authorization' && state.meta.mta_log.error.operation !== 'authorization'
) { ) {
const errorType = MailerMixin.getMailerErrorType(state); const errorType = MailerMixin.getMailerErrorType(state);
let container = jQuery('[data-id="mailpoet_mailer_error"]')[0];
if (!container) {
MailPoet.Notice[errorType]( MailPoet.Notice[errorType](
'', '',
{ static: true, id: 'mailpoet_mailer_error' } { static: true, id: 'mailpoet_mailer_error' }
); );
container = jQuery('[data-id="mailpoet_mailer_error"]')[0];
}
ReactDOM.render( ReactDOM.render(
MailerMixin.getMailerError(state), MailerMixin.getMailerError(state),
jQuery('[data-id="mailpoet_mailer_error"]')[0] container
); );
} else { } else {
MailPoet.Notice.hide('mailpoet_mailer_error'); MailPoet.Notice.hide('mailpoet_mailer_error');