mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-05-24 14:45:36 +00:00
set purchased.plan.dateUpdated during cron if it hasn't been set - ref https://github.com/HabitRPG/habitrpg/issues/6682
This commit is contained in:
parent
13c06756e3
commit
e7c88d6e5d
1 changed files with 4 additions and 0 deletions
|
|
@ -2415,6 +2415,10 @@ api.wrap = function(user, main) {
|
|||
};
|
||||
plan = (ref = user.purchased) != null ? ref.plan : void 0;
|
||||
if (plan != null ? plan.customerId : void 0) {
|
||||
if (typeof plan.dateUpdated === "undefined") {
|
||||
// partial compensation for bug in subscription creation - https://github.com/HabitRPG/habitrpg/issues/6682
|
||||
plan.dateUpdated = new Date();
|
||||
}
|
||||
if (moment(plan.dateUpdated).format('MMYYYY') !== moment().format('MMYYYY')) {
|
||||
plan.gemsBought = 0;
|
||||
plan.dateUpdated = new Date();
|
||||
|
|
|
|||
Loading…
Reference in a new issue