Skip to content

Commit 58ab3b4

Browse files
authored
Fix no big number for dashbaord without timeseries (#7224)
1 parent 919c0c5 commit 58ab3b4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

web-common/src/features/dashboards/big-number/MeasuresContainer.svelte

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,12 @@
152152
calculateGridColumns();
153153
}
154154
155-
function getValue(key: string | undefined): number | null {
155+
$: totalsQueryRow = totalsQueryResult.data?.data?.[0];
156+
// Make this reactive to totalsQueryRow so that data is updated if query is refetched
157+
$: getValue = (key: string | undefined): number | null => {
156158
if (!key) return null;
157-
return totalsQueryResult.data?.data?.[0]?.[key] as number | null;
158-
}
159+
return totalsQueryRow?.[key] as number | null;
160+
};
159161
</script>
160162

161163
<svelte:window on:resize={() => calculateGridColumns()} />

0 commit comments

Comments
 (0)