0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-17 23:44:39 -05:00

Fixed "Already sent" showing in publish options when email disabled in settings

refs 46f01c2d8f

- if you had previously had emails enabled and you had sent a post as an email, when disabling members/emails all email related UI was hidden except for the "Already sent as email" message when publishing which was confusing as there is no other indication anywhere about emails and no way to view it
- added `emailDisabledInSettings` getter to PublishOptions
  - used in `emailUnavailable` getter in place of a duplicate read of the settings
  - used in the `<PublishFlow::Options>` component to conditionally hide the "Already sent" message
This commit is contained in:
Kevin Ansfield 2022-05-11 09:43:55 +01:00
parent 46f01c2d8f
commit 28919eb057
2 changed files with 7 additions and 5 deletions

View file

@ -82,7 +82,7 @@
</div>
{{/unless}}
{{#if @publishOptions.post.email}}
{{#if (and @publishOptions.post.email (not @publishOptions.emailDisabledInSettings))}}
<div class="gh-publish-setting">
<div class="gh-publish-setting-title disabled">
{{svg-jar "member"}}

View file

@ -112,12 +112,14 @@ export class PublishOptions {
return this.publishTypeOptions.find(pto => pto.value === this.publishType);
}
get emailDisabledInSettings() {
return get(this.settings, 'editorDefaultEmailRecipients') === 'disabled'
|| get(this.settings, 'membersSignupAccess') === 'none';
}
// publish type dropdown is not shown at all
get emailUnavailable() {
const emailDisabled = get(this.settings, 'editorDefaultEmailRecipients') === 'disabled'
|| get(this.settings, 'membersSignupAccess') === 'none';
return this.post.isPage || this.post.email || !this.user.canEmail || emailDisabled;
return this.post.isPage || this.post.email || !this.user.canEmail || this.emailDisabledInSettings;
}
// publish type dropdown is shown but email options are disabled