revert(ui): remove VirtualKeysTable useMemo fix from credential fix branch

Already covered by fix/virtual-keys-infinite-rerender. Keep credential
fix PR scope focused on the stale credential list bug only.

Co-Authored-By: Claude Sonnet 4 (1M context) <noreply@anthropic.com>
This commit is contained in:
Bytechoreographer 2026-04-16 17:15:43 +08:00
parent 32d93bb0ea
commit 0a7fc610ee

View file

@ -94,15 +94,11 @@ export function VirtualKeysTable({ teams, organizations, onSortChange, currentSo
});
const [expandedAccordions, setExpandedAccordions] = useState<Record<string, boolean>>({});
// Stabilize the keys array reference so that useFilterLogic's useEffect
// (which depends on `keys`) only fires when the actual data changes, not on
// every render caused by setFilteredKeys → re-render → new [] literal.
const stableKeys = useMemo(() => keys?.keys ?? [], [keys]);
// Use the filter logic hook
const { filters, filteredKeys, filteredTotalCount, allTeams, allOrganizations, handleFilterChange, handleFilterReset } =
useFilterLogic({
keys: stableKeys,
keys: keys?.keys || [],
teams,
organizations,
});