Commit 743e29f2 authored by Guilhem CARRON's avatar Guilhem CARRON
Browse files

fix(conso): Disable half hour check if fluid different from elec

parent 2680d109
......@@ -55,16 +55,18 @@ const FluidChart: React.FC<FluidChartProps> = ({
let isEnedisConsentValid = true
async function loadData() {
const consumptionService = new ConsumptionService(client)
const activateHalfHourLoad = await consumptionService.checkDoctypeEntries(
FluidType.ELECTRICITY,
TimeStep.HALF_AN_HOUR
)
let activateHalfHourLoad = false
if (fluidType === FluidType.ELECTRICITY) {
activateHalfHourLoad = await consumptionService.checkDoctypeEntries(
FluidType.ELECTRICITY,
TimeStep.HALF_AN_HOUR
)
}
if (currentTimeStep === TimeStep.HALF_AN_HOUR && activateHalfHourLoad) {
isEnedisConsentValid = await consumptionService.checkEnedisHalHourConsent(
selectedDate
)
}
if (subscribed) {
if (!activateHalfHourLoad) {
setMinuteBlocked(true)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment