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

Fixed undefined member count for scheduled posts in publish update flow

no issue

- in the update flow we were always using `post.email.emailCount` but scheduled posts won't yet have a `post.email` record
- switched to showing a count of members based on the post's newsletter slug and `emailRecipientFilter`
This commit is contained in:
Kevin Ansfield 2022-05-09 14:11:07 +01:00
parent 2768dc74ad
commit e74b042d18

View file

@ -32,7 +32,13 @@
published and sent to
{{/if}}
<strong>{{pluralize post.email.emailCount "member"}}</strong>.
{{#if post.isScheduled}}
{{#let (members-count-fetcher query=(hash filter=(concat "newsletters:" post.newsletter.slug "+" post.emailRecipientFilter))) as |countFetcher|}}
<strong>{{gh-pluralize countFetcher.count "member"}}</strong>.
{{/let}}
{{else}}
<strong>{{pluralize post.email.emailCount "member"}}</strong>.
{{/if}}
{{else}}
published.
{{/if}}