Skip to content

Commit 25dfac6

Browse files
authored
fix: get web vitals value for gauge component (#1059)
Replaced refId filtering with direct access to the first series. as refId became unreliable
1 parent 654f478 commit 25dfac6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎src/scenes/BROWSER/WebVitals/webVitalGaugeScene.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ function WebVitalGaugeRenderer({ model }: SceneComponentProps<WebVitalGaugeScene
3030
setExploreLink(model);
3131

3232
const { data } = sceneGraph.getData(model).useState();
33-
const { name, description, longName, refId, exploreLink } = model.useState();
33+
const { name, description, longName, exploreLink } = model.useState();
3434
const value = useMemo(() => {
3535
if (data != null && data.state === 'Done') {
3636
if (!data || data.series.length === 0) {
3737
return 0;
3838
}
3939

40-
const frame = data.series.find((s) => s.refId === refId);
40+
const frame = data.series[0];
4141

4242
if (!frame) {
4343
return 0;
@@ -47,7 +47,7 @@ function WebVitalGaugeRenderer({ model }: SceneComponentProps<WebVitalGaugeScene
4747

4848
return view.toArray()[0]?.Mean;
4949
}
50-
}, [data, refId]);
50+
}, [data]);
5151

5252
return (
5353
<div className={styles}>

0 commit comments

Comments
 (0)