Skip to content

Commit 179a982

Browse files
jurajmajerikcarlos-marchal-ph
authored andcommitted
fix(experiments): Use correct order variant order in Exposures (#39107)
1 parent 6cae35c commit 179a982

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

frontend/src/scenes/experiments/ExperimentView/Exposures.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,17 @@ export function Exposures(): JSX.Element {
4242
let totalExposures = 0
4343
const variants: Array<{ variant: string; count: number; percentage: number }> = []
4444

45-
if (exposures?.total_exposures) {
46-
for (const [, count] of Object.entries(exposures.total_exposures)) {
45+
if (exposures?.timeseries) {
46+
for (const series of exposures.timeseries) {
47+
const count = exposures.total_exposures?.[series.variant] || 0
4748
totalExposures += Number(count)
4849
}
4950

5051
// Calculate percentages for each variant
51-
for (const [variant, count] of Object.entries(exposures.total_exposures)) {
52+
for (const series of exposures.timeseries) {
53+
const count = exposures.total_exposures?.[series.variant] || 0
5254
variants.push({
53-
variant,
55+
variant: series.variant,
5456
count: Number(count),
5557
percentage: totalExposures ? (Number(count) / totalExposures) * 100 : 0,
5658
})

0 commit comments

Comments
 (0)