2022-05-05 17:59:34 +03:00
|
|
|
import Component from '@glimmer/component';
|
|
|
|
import {task} from 'ember-concurrency';
|
|
|
|
|
|
|
|
export default class UpdateFlowModalComponent extends Component {
|
|
|
|
static modalOptions = {
|
2022-05-19 14:19:49 +03:00
|
|
|
className: 'fullscreen-modal-total-overlay publish-modal',
|
2022-05-05 17:59:34 +03:00
|
|
|
omitBackdrop: true,
|
|
|
|
ignoreBackdropClick: true
|
|
|
|
};
|
|
|
|
|
2022-05-12 13:38:58 +03:00
|
|
|
// We only show the newsletter name in the app if there's more than the single default newsletter.
|
|
|
|
// However, here we can show historic email data so it could have been sent to a now-archived
|
|
|
|
// newsletter in which case we want to force display of the newsletter name to avoid confusion.
|
|
|
|
get showNewsletterName() {
|
|
|
|
const {publishOptions} = this.args.data;
|
|
|
|
|
|
|
|
return !publishOptions.onlyDefaultNewsletter
|
|
|
|
|| publishOptions.post.newsletter?.status === 'archived';
|
|
|
|
}
|
|
|
|
|
2022-05-05 17:59:34 +03:00
|
|
|
@task
|
|
|
|
*saveTask() {
|
|
|
|
yield this.args.data.saveTask.perform();
|
|
|
|
this.args.close();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|