mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
fix(hourglass): handle missing planId
This commit is contained in:
@@ -287,7 +287,7 @@ export function getPlanContext (user, now) {
|
|||||||
const dateUpdatedMoment = moment(plan.dateUpdated).startOf('month');
|
const dateUpdatedMoment = moment(plan.dateUpdated).startOf('month');
|
||||||
const elapsedMonths = moment(subscriptionEndDate).diff(dateUpdatedMoment, 'months');
|
const elapsedMonths = moment(subscriptionEndDate).diff(dateUpdatedMoment, 'months');
|
||||||
|
|
||||||
const planMonths = subscriptionBlocks[plan.planId].months || 1;
|
const planMonths = subscriptionBlocks[plan.planId] ? subscriptionBlocks[plan.planId].months : 1;
|
||||||
let monthsTillNextHourglass;
|
let monthsTillNextHourglass;
|
||||||
if (planMonths > 1) {
|
if (planMonths > 1) {
|
||||||
monthsTillNextHourglass = plan.consecutive.offset + 1;
|
monthsTillNextHourglass = plan.consecutive.offset + 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user