reset perkMonthCount when subscription ends

This commit is contained in:
Phillip Thelen
2023-02-15 10:05:18 +01:00
parent 6ee2e3a379
commit 3203b09b7a

View File

@@ -279,6 +279,8 @@ export async function cron (options = {}) {
if (user.isSubscribed()) {
await grantEndOfTheMonthPerks(user, now);
} if (!user.isSubscribed() && user.purchased.plan.perkMonthCount > 0) {
user.purchased.plan.perkMonthCount = 0;
}
const { plan } = user.purchased;