Fixed create newsletter confirmation showing when editing existing newsletter

closes https://github.com/TryGhost/Team/issues/1537

- added conditional around the create confirmation modal display so it's only shown when attempting to save a new newsletter record
This commit is contained in:
Kevin Ansfield 2022-04-20 12:52:20 +01:00
parent 58290a6134
commit e7ddf8aaef

View File

@ -55,15 +55,17 @@ export default class EditNewsletterModal extends Component {
const {optInExisting} = this;
const shouldCreate = yield this.modals.open(ConfirmCreateModal, {
optInExisting,
newsletter: this.args.data.newsletter,
activeNewsletterSlugs: this.activeNewsletterSlugs
});
if (this.args.data.newsletter.isNew) {
const shouldCreate = yield this.modals.open(ConfirmCreateModal, {
optInExisting,
newsletter: this.args.data.newsletter,
activeNewsletterSlugs: this.activeNewsletterSlugs
});
if (!shouldCreate) {
// ensure task button returns to idle state
return 'canceled';
if (!shouldCreate) {
// ensure task button returns to idle state
return 'canceled';
}
}
const newEmail = this.args.data.newsletter.senderEmail;