Fixed publish confirmation button text

no issue

- the button text would still say "Publish & send" when no members were selected
- changed from comparing `publishOptions.publishType` directly to using the `willPublish` and `willEmail` convenience getters so the button text better matches the action being taken
This commit is contained in:
Kevin Ansfield 2022-05-11 09:25:23 +01:00
parent ce81b9c342
commit 8652f16005

View File

@ -11,16 +11,16 @@ export default class PublishFlowOptions extends Component {
willPublish = this.args.publishOptions.willPublish;
get confirmButtonText() {
const publishType = this.args.publishOptions.publishType;
const publishOptions = this.args.publishOptions;
let buttonText = '';
if (publishType === 'publish+send') {
if (publishOptions.willPublish && publishOptions.willEmail) {
buttonText = 'Publish & send';
} else if (publishType === 'publish') {
buttonText = `Publish ${this.args.publishOptions.post.displayName}`;
} else if (publishType === 'send') {
} else if (publishOptions.willOnlyEmail) {
buttonText = 'Send email';
} else {
buttonText = `Publish ${this.args.publishOptions.post.displayName}`;
}
if (this.args.publishOptions.isScheduled) {