dashboard: lazy load charts on overview

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-03-26 22:14:18 +01:00
parent 44c66dbed4
commit 64701bf29f
7 changed files with 23 additions and 16 deletions

View File

@@ -31,12 +31,17 @@ export function Chart({
startDate,
endDate,
}: ReportChartProps) {
const [references] = api.reference.getChartReferences.useSuspenseQuery({
projectId,
startDate,
endDate,
range,
});
const [references] = api.reference.getChartReferences.useSuspenseQuery(
{
projectId,
startDate,
endDate,
range,
},
{
staleTime: 1000 * 60 * 5,
}
);
const [data] = api.chart.chart.useSuspenseQuery(
{