Show loader on cancel

[MAILPOET-2693]
This commit is contained in:
Amine Ben hammou
2020-04-17 14:03:33 +02:00
committed by Veljko V
parent 2503e3bae7
commit cd73faaff7
2 changed files with 6 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
import React from 'react';
import { useHistory } from 'react-router-dom';
import MailPoet from 'mailpoet';
import { t } from 'common/functions';
import { useAction } from 'settings/store/hooks';
@@ -14,8 +15,10 @@ export default function ActivateOrCancel() {
};
const cancel = async (e) => {
e.preventDefault();
MailPoet.Modal.loading(true);
await loadSettings();
history.push('/mta');
MailPoet.Modal.loading(false);
};
return (
<p>

View File

@@ -206,6 +206,9 @@ export function* reinstall() {
}
export function* sendTestEmail(recipient: string, mailer: Settings['mta']) {
if (!recipient) {
return { type: 'TEST_EMAIL_FAILED', error: [t('cantSendEmail')] };
}
yield { type: 'START_TEST_EMAIL_SENDING' };
const res = yield {
type: 'CALL_API',