mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-17 01:12:18 +00:00
fix(lint): line lengths and so on
This commit is contained in:
parent
82a1d6ff0e
commit
e81a052f66
2 changed files with 3 additions and 4 deletions
|
|
@ -63,9 +63,6 @@ const CLEAR_BUFFS = {
|
|||
};
|
||||
|
||||
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);
|
||||
|
||||
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)
|
||||
plan.consecutive.offset = planMonthsLength - 1;
|
||||
}
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
await plan.incrementPerkCounterAndReward(user._id, planMonthsLength);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,7 +47,8 @@ schema.plugin(baseModel, {
|
|||
_id: false,
|
||||
});
|
||||
|
||||
schema.methods.incrementPerkCounterAndReward = async function incrementPerkCounterAndReward (userID, adding) {
|
||||
schema.methods.incrementPerkCounterAndReward = async function incrementPerkCounterAndReward
|
||||
(userID, adding) {
|
||||
this.perkMonthCount += adding;
|
||||
|
||||
const perks = Math.floor(this.perkMonthCount / 3);
|
||||
|
|
|
|||
Loading…
Reference in a new issue