From 00047de1c6d8d543e757b89d6a239da2a681a85b Mon Sep 17 00:00:00 2001 From: Krish Dholakia Date: Thu, 12 Sep 2024 22:15:52 -0700 Subject: [PATCH] fix(user_dashboard.tsx): don't call /global/spend on startup (#5668) at 1m+ rows, query timeouts cause ui errors --- .../src/components/user_dashboard.tsx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/ui/litellm-dashboard/src/components/user_dashboard.tsx b/ui/litellm-dashboard/src/components/user_dashboard.tsx index 660e1a6d9..712e42676 100644 --- a/ui/litellm-dashboard/src/components/user_dashboard.tsx +++ b/ui/litellm-dashboard/src/components/user_dashboard.tsx @@ -182,13 +182,14 @@ const UserDashboard: React.FC = ({ response )}; team values: ${Object.entries(response.teams)}` ); - if (userRole == "Admin") { - const globalSpend = await getTotalSpendCall(accessToken); - setUserSpendData(globalSpend); - console.log("globalSpend:", globalSpend); - } else { - setUserSpendData(response["user_info"]); - } + // if (userRole == "Admin") { + // const globalSpend = await getTotalSpendCall(accessToken); + // setUserSpendData(globalSpend); + // console.log("globalSpend:", globalSpend); + // } else { + // ); + // } + setUserSpendData(response["user_info"]); setKeys(response["keys"]); // Assuming this is the correct path to your data setTeams(response["teams"]); const teamsArray = [...response["teams"]];