diff --git a/ui/litellm-dashboard/src/components/view_users/table.tsx b/ui/litellm-dashboard/src/components/view_users/table.tsx index 7f4a4d7ea9..7674a6491f 100644 --- a/ui/litellm-dashboard/src/components/view_users/table.tsx +++ b/ui/litellm-dashboard/src/components/view_users/table.tsx @@ -78,6 +78,16 @@ export function UserDataTable({ setSelectedUserId(null); }; + // Update local sorting state when currentSort prop changes + React.useEffect(() => { + if (currentSort) { + setSorting([{ + id: currentSort.sortBy, + desc: currentSort.sortOrder === 'desc' + }]); + } + }, [currentSort]); + if (selectedUserId) { return ( { - if (currentSort) { - setSorting([{ - id: currentSort.sortBy, - desc: currentSort.sortOrder === 'desc' - }]); - } - }, [currentSort]); - return (