From 57db40e7b3d6d23e6c496f57d1c9ff0ceafaddd5 Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Tue, 14 Oct 2025 02:24:11 +0000 Subject: [PATCH] Refactor profile loading effect cgen-add78cac0b7f4d31b999c96257319858 --- client/pages/Admin.tsx | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/client/pages/Admin.tsx b/client/pages/Admin.tsx index 29de628c..25e827a0 100644 --- a/client/pages/Admin.tsx +++ b/client/pages/Admin.tsx @@ -89,17 +89,21 @@ export default function Admin() { const [applicationsLoading, setApplicationsLoading] = useState(false); const [selectedMemberId, setSelectedMemberId] = useState(null); - useEffect(() => { - (async () => { - try { - const list = await aethexUserService.listProfiles(50); - setManagedProfiles(list); - } catch (error) { - console.warn("Failed to load managed profiles:", error); - setManagedProfiles([]); - } - })(); + const loadProfiles = useCallback(async () => { + try { + const list = await aethexUserService.listProfiles(200); + setManagedProfiles(list); + } catch (error) { + console.warn("Failed to load managed profiles:", error); + setManagedProfiles([]); + } + }, []); + useEffect(() => { + loadProfiles().catch(() => undefined); + }, [loadProfiles]); + + useEffect(() => { fetch("/api/featured-studios") .then((r) => (r.ok ? r.json() : [])) .then((data) => {