mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-15 21:57:22 +01:00
Fix subcriptions remaining time disappearing after cancelling (#10761)
* add hasCancelled method for group/user, prevent cancelling a subscription twice * wip * paypal: do not cancel a subscription twice * make sure hasCancelled and hasNotCancelled return a boolean result
This commit is contained in:
@@ -1421,7 +1421,12 @@ schema.methods.isSubscribed = function isSubscribed () {
|
||||
|
||||
schema.methods.hasNotCancelled = function hasNotCancelled () {
|
||||
let plan = this.purchased.plan;
|
||||
return this.isSubscribed() && !plan.dateTerminated;
|
||||
return Boolean(this.isSubscribed() && !plan.dateTerminated);
|
||||
};
|
||||
|
||||
schema.methods.hasCancelled = function hasNotCancelled () {
|
||||
let plan = this.purchased.plan;
|
||||
return Boolean(this.isSubscribed() && plan.dateTerminated);
|
||||
};
|
||||
|
||||
schema.methods.updateGroupPlan = async function updateGroupPlan (removingMember) {
|
||||
|
||||
Reference in New Issue
Block a user