From df76316dcd66c0605dbf5c534381d1335c4098d1 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Sat, 14 Dec 2024 15:33:03 -0800 Subject: [PATCH] ui fix tags getting proxy settings (#7234) --- ui/litellm-dashboard/src/components/usage.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ui/litellm-dashboard/src/components/usage.tsx b/ui/litellm-dashboard/src/components/usage.tsx index 2e45b9ca9bc..7fd6e1ad5b6 100644 --- a/ui/litellm-dashboard/src/components/usage.tsx +++ b/ui/litellm-dashboard/src/components/usage.tsx @@ -244,7 +244,11 @@ const UsagePage: React.FC = ({ return; } - if (proxySettings?.DISABLE_EXPENSIVE_DB_QUERIES) { + + // we refetch because the state variable can be None when the user refreshes the page + const proxy_settings: ProxySettings | undefined = await fetchProxySettings(); + + if (proxy_settings?.DISABLE_EXPENSIVE_DB_QUERIES) { return; // Don't run expensive DB queries - return out when SpendLogs has more than 1M rows }