From 83e2a6b3c466a7b0ed370c228d1322af51c2c419 Mon Sep 17 00:00:00 2001 From: Juraj Majerik Date: Fri, 3 Oct 2025 17:24:35 +0200 Subject: [PATCH] init --- .../scenes/experiments/ExperimentView/Exposures.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/frontend/src/scenes/experiments/ExperimentView/Exposures.tsx b/frontend/src/scenes/experiments/ExperimentView/Exposures.tsx index f192c3f8ea3a5..0278fa897d9f8 100644 --- a/frontend/src/scenes/experiments/ExperimentView/Exposures.tsx +++ b/frontend/src/scenes/experiments/ExperimentView/Exposures.tsx @@ -40,15 +40,17 @@ export function Exposures(): JSX.Element { let totalExposures = 0 const variants: Array<{ variant: string; count: number; percentage: number }> = [] - if (exposures?.total_exposures) { - for (const [, count] of Object.entries(exposures.total_exposures)) { + if (exposures?.timeseries) { + for (const series of exposures.timeseries) { + const count = exposures.total_exposures?.[series.variant] || 0 totalExposures += Number(count) } // Calculate percentages for each variant - for (const [variant, count] of Object.entries(exposures.total_exposures)) { + for (const series of exposures.timeseries) { + const count = exposures.total_exposures?.[series.variant] || 0 variants.push({ - variant, + variant: series.variant, count: Number(count), percentage: totalExposures ? (Number(count) / totalExposures) * 100 : 0, })