mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
🐛 Fixed missing complimentary subscription add button
refs 81de2fe223
refs https://github.com/TryGhost/Team/issues/758
The "Add complimentary" subscription button in members does not show up when members already have an existing zero amount subscription. But this was incorrectly not taking into account active subscriptions and was applying the rule to canceled subscriptions. Since the `comped` behaviour changed in 4.6 which caused member's existing comp subscription to be canceled, this bug did not allow the comped subscription to be added back.
This commit is contained in:
parent
0fb9417ed5
commit
1bfd37d24c
1 changed files with 3 additions and 1 deletions
|
@ -31,7 +31,9 @@ export default class extends Component {
|
|||
|
||||
get isAddComplimentaryAllowed() {
|
||||
let subscriptions = this.member.get('subscriptions') || [];
|
||||
const hasZeroPriceSub = subscriptions.find((sub) => {
|
||||
const hasZeroPriceSub = subscriptions.filter((sub) => {
|
||||
return ['active', 'trialing', 'unpaid', 'past_due'].includes(sub.status);
|
||||
}).find((sub) => {
|
||||
return !sub?.price?.amount;
|
||||
});
|
||||
return !hasZeroPriceSub;
|
||||
|
|
Loading…
Add table
Reference in a new issue