fix(subscriptions): don't reset Gems midmonth

This commit is contained in:
Sabe Jones
2016-10-10 15:52:33 +00:00
parent ff08e8b586
commit 3c4c64b023
2 changed files with 23 additions and 1 deletions

View File

@@ -125,7 +125,7 @@ export function cron (options = {}) {
let perfect = true;
// Reset Gold-to-Gems cap if it's the start of the month
if (user.purchased && user.purchased.plan && moment(user.purchased.plan.dateUpdated).startOf('month') !== moment().startOf('month')) {
if (user.purchased && user.purchased.plan && !moment(user.purchased.plan.dateUpdated).startOf('month').isSame(moment().startOf('month'))) {
user.purchased.plan.gemsBought = 0;
}
if (user.isSubscribed()) {