From 84cb396a4fd90369a416ae1232af02798af750d6 Mon Sep 17 00:00:00 2001 From: Griffin Tarpenning Date: Wed, 22 Jan 2025 14:08:02 -0800 Subject: [PATCH] chore(ui): dont do the cost query if no calls found (#3469) --- .../Home/Browse3/pages/CallsPage/callsTableQuery.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/CallsPage/callsTableQuery.ts b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/CallsPage/callsTableQuery.ts index 980453a90692..a30928b70b59 100644 --- a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/CallsPage/callsTableQuery.ts +++ b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/CallsPage/callsTableQuery.ts @@ -97,6 +97,7 @@ export const useCallsForQuery = ( ); const costCols = useMemo(() => ['id'], []); + const noCalls = calls.result == null || calls.result.length === 0; const costs = useCalls( entity, project, @@ -108,7 +109,7 @@ export const useCallsForQuery = ( costCols, expandedColumns, { - skip: calls.loading, + skip: calls.loading || noCalls, includeCosts: true, } );