return sending queue object for standard / newsletter for automated\n- bugfix loading screen not going away\n- fixed not being used in sending queue endpoint

This commit is contained in:
Jonathan Labreuille
2016-08-09 16:52:04 +02:00
parent 22e8e34213
commit f690e1a095
3 changed files with 12 additions and 7 deletions

View File

@@ -108,8 +108,9 @@ define(
} else {
return response;
}
}).done((response) => {
}).always(() => {
this.setState({ loading: false });
}).done((response) => {
// redirect to listing based on newsletter type
this.context.router.push(`/${ this.state.item.type || '' }`);
// display success message depending on newsletter type
@@ -118,7 +119,11 @@ define(
} else if (this.state.item.type === 'notification') {
MailPoet.Notice.success(MailPoet.I18n.t('postNotificationActivated'));
} else {
MailPoet.Notice.success(MailPoet.I18n.t('newsletterBeingSent'));
if (response.data.status === 'scheduled') {
MailPoet.Notice.success(MailPoet.I18n.t('newsletterHasBeenScheduled'));
} else {
MailPoet.Notice.success(MailPoet.I18n.t('newsletterBeingSent'));
}
}
}).fail((response) => {
if (response.errors.length > 0) {