Use const and early return
This commit is contained in:
committed by
M. Shull
parent
b91cc0639d
commit
47a1c22366
@@ -21,8 +21,10 @@ const resumeMailerSending = () => {
|
||||
});
|
||||
};
|
||||
|
||||
function MailerError(props) {
|
||||
if (props.mta_log.error && props.mta_log.status === 'paused' && props.mta_log.error.operation !== 'authorization') {
|
||||
const MailerError = (props) => {
|
||||
if (!props.mta_log.error || props.mta_log.status !== 'paused' || props.mta_log.error.operation === 'authorization') {
|
||||
return null;
|
||||
}
|
||||
if (props.mta_log.error.operation === 'migration') {
|
||||
return (
|
||||
<div className="mailpoet_notice notice notice-warning">
|
||||
@@ -61,9 +63,7 @@ function MailerError(props) {
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
MailerError.propTypes = {
|
||||
mta_method: PropTypes.string.isRequired,
|
||||
|
Reference in New Issue
Block a user