Skip to content
Snippets Groups Projects
Commit 2730b080 authored by Yoan VALLET's avatar Yoan VALLET
Browse files

feat: send compare event only when comparison is activated

parent df01f121
No related branches found
No related tags found
1 merge request!348Features/create aggregation usage service
...@@ -60,11 +60,13 @@ const FluidChart: React.FC<FluidChartProps> = ({ ...@@ -60,11 +60,13 @@ const FluidChart: React.FC<FluidChartProps> = ({
}, [dispatch]) }, [dispatch])
const handleChangeSwitch = async () => { const handleChangeSwitch = async () => {
await UsageEventService.addEvent(client, { if (!showCompare) {
type: UsageEventType.CONSUMPTION_COMPARE_EVENT, await UsageEventService.addEvent(client, {
target: TimeStep[currentTimeStep].toLowerCase(), type: UsageEventType.CONSUMPTION_COMPARE_EVENT,
context: FluidType[fluidType].toLowerCase(), target: TimeStep[currentTimeStep].toLowerCase(),
}) context: FluidType[fluidType].toLowerCase(),
})
}
setShowCompare(!showCompare) setShowCompare(!showCompare)
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment