0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-04-08 02:52:39 -05:00

🐛 Fixed confusing wording change whilst saving in publish confirmation modal

no issue

- after clicking the "Publish and send" button in the publish confirmation modal the post is saved and an email is created which caused the wording to change to automatically switch to the "publish only" state because posts with existing emails can't be sent again
- changed the wording-choice data to be set statically based on data available when the modal is triggered rather than auto-updated based on overall system state
This commit is contained in:
Kevin Ansfield 2022-01-04 18:05:34 +00:00
parent f56b52b8a1
commit 6a673ce8e1

View file

@ -14,16 +14,6 @@ export default class ModalsEditorConfirmPublishComponent extends Component {
@tracked memberCount = null;
@tracked memberCountString = null;
get isPublishOnly() {
return this.args.data.sendEmailWhenPublished === 'none'
|| this.args.data.post.displayName === 'page'
|| this.args.data.post.email;
}
get isEmailOnly() {
return this.args.data.emailOnly;
}
get isEmailOnlyWithNoMembers() {
return this.isEmailOnly && this.memberCount === 0;
}
@ -40,6 +30,17 @@ export default class ModalsEditorConfirmPublishComponent extends Component {
return 'Publish and Send';
}
constructor() {
super(...arguments);
// set static up-front so it doesn't change when post is saved and email is created
this.isPublishOnly = this.args.data.sendEmailWhenPublished === 'none'
|| this.args.data.post.displayName === 'page'
|| this.args.data.post.email;
this.isEmailOnly = this.args.data.emailOnly;
}
@action
confirm() {
if (this.errorMessage) {