Fix wrong unlocked incident level on the last day of month
This commit is contained in:
@@ -177,8 +177,8 @@ const setUnlockedIncidentsLevel = (incidents) => {
|
||||
formattedIncident.incidentLevel = unlockedIncidentLevelsPrices.UNLOCKED_0.title;
|
||||
formattedIncident.incidentLevelPrice = unlockedIncidentLevelsPrices.UNLOCKED_0.price;
|
||||
} else {
|
||||
const lastIncidentTime = moment.utc(memberLastIncident.incidentTimestamp).startOf('month');
|
||||
const currentIncidentTime = moment.utc(incident.unlockTimestamp).startOf('month');
|
||||
const lastIncidentTime = moment.tz(memberLastIncident.incidentTimestamp, UI_TIMEZONE).startOf('month');
|
||||
const currentIncidentTime = moment.tz(incident.unlockTimestamp, UI_TIMEZONE).startOf('month');
|
||||
const timeDiff = Math.abs(lastIncidentTime.diff(currentIncidentTime, 'months'));
|
||||
|
||||
if (timeDiff >= (parseInt(process.env.UNLOCK_STREAK_REPAIR_AFTER) || 6)){
|
||||
|
||||
Reference in New Issue
Block a user