From f383a37b0164500d154e3cbbc9093b2d46854bcb Mon Sep 17 00:00:00 2001 From: Sai Shankar Date: Sun, 8 Mar 2026 21:39:19 +0530 Subject: [PATCH] fix(costs): replace non-null map assertions with nullish coalescing, clarify weekData guard --- ui/src/pages/Costs.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ui/src/pages/Costs.tsx b/ui/src/pages/Costs.tsx index 4b6cea09..dbecaccb 100644 --- a/ui/src/pages/Costs.tsx +++ b/ui/src/pages/Costs.tsx @@ -149,6 +149,10 @@ export function Costs() { staleTime: 10_000, }); + // weekData intentionally omits the customReady guard — it always uses the + // fixed current-week range (weekRange), not the user's custom date selection. + // running it unconditionally (when the providers tab is active) ensures the + // week-over-week spend column is always populated on tab mount. const { data: weekData } = useQuery({ queryKey: queryKeys.usageByProvider(companyId, weekRange.from, weekRange.to), queryFn: () => costsApi.byProvider(companyId, weekRange.from, weekRange.to), @@ -524,7 +528,7 @@ export function Costs() {