mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
fix(lint): line lengths and so on
This commit is contained in:
@@ -63,9 +63,6 @@ const CLEAR_BUFFS = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
async function grantEndOfTheMonthPerks (user, now) {
|
async function grantEndOfTheMonthPerks (user, now) {
|
||||||
// multi-month subscriptions are for multiples of 3 months
|
|
||||||
const SUBSCRIPTION_BASIC_BLOCK_LENGTH = 3;
|
|
||||||
|
|
||||||
const { plan, elapsedMonths } = getPlanContext(user, now);
|
const { plan, elapsedMonths } = getPlanContext(user, now);
|
||||||
|
|
||||||
if (elapsedMonths > 0) {
|
if (elapsedMonths > 0) {
|
||||||
@@ -115,6 +112,7 @@ async function grantEndOfTheMonthPerks (user, now) {
|
|||||||
// (subtract 1 because we should have run this when the payment was taken last month)
|
// (subtract 1 because we should have run this when the payment was taken last month)
|
||||||
plan.consecutive.offset = planMonthsLength - 1;
|
plan.consecutive.offset = planMonthsLength - 1;
|
||||||
}
|
}
|
||||||
|
// eslint-disable-next-line no-await-in-loop
|
||||||
await plan.incrementPerkCounterAndReward(user._id, planMonthsLength);
|
await plan.incrementPerkCounterAndReward(user._id, planMonthsLength);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,8 @@ schema.plugin(baseModel, {
|
|||||||
_id: false,
|
_id: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
schema.methods.incrementPerkCounterAndReward = async function incrementPerkCounterAndReward (userID, adding) {
|
schema.methods.incrementPerkCounterAndReward = async function incrementPerkCounterAndReward
|
||||||
|
(userID, adding) {
|
||||||
this.perkMonthCount += adding;
|
this.perkMonthCount += adding;
|
||||||
|
|
||||||
const perks = Math.floor(this.perkMonthCount / 3);
|
const perks = Math.floor(this.perkMonthCount / 3);
|
||||||
|
|||||||
Reference in New Issue
Block a user