Stop blocking user on template save

When the template save function throws an error
the newsletter is already being sent. We cannot
stop users.

[MAILPOET-1325]
This commit is contained in:
Pavel Dohnal
2018-06-05 16:45:47 +01:00
parent 0f46ecc433
commit 20cecc885a
2 changed files with 5 additions and 2 deletions

View File

@@ -74,7 +74,7 @@ const NewsletterSend = React.createClass({
},
saveTemplate: function saveTemplate(response, done) {
fromUrl(response.meta.preview_url)
.then(function saveTemplateAjax(thumbnail) {
.then((thumbnail) => {
MailPoet.Ajax.post({
api_version: window.mailpoet_api_version,
endpoint: 'newsletterTemplates',
@@ -88,6 +88,9 @@ const NewsletterSend = React.createClass({
},
}).then(done).fail((err) => {
this.showError(err);
this.setState({ loading: false });
MailPoet.Modal.loading(false);
done();
});
})
.catch((err) => {

View File

@@ -101,4 +101,4 @@ class ViewInBrowser {
status_header(404);
exit;
}
}
}