From 4836d6cc37bdc181d85ecf901ec5dbb9f48fb7bc Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Sun, 5 Oct 2025 01:45:20 +0000 Subject: [PATCH] Simplify loading guard cgen-12bbd70826b54f0fb9f30e1bc496a8fe --- client/pages/ProfilePassport.tsx | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/client/pages/ProfilePassport.tsx b/client/pages/ProfilePassport.tsx index 741f2289..f35f5565 100644 --- a/client/pages/ProfilePassport.tsx +++ b/client/pages/ProfilePassport.tsx @@ -95,33 +95,7 @@ const ProfilePassport = () => { let cancelled = false; - const profileMatchesCurrentTarget = (() => { - if (!profile) { - return false; - } - if (normalizedUsername) { - return ( - profile.username?.toLowerCase() === normalizedUsername || - profile.id === requestedUsername - ); - } - if (isSelfRoute) { - if (user?.id && profile.id === user.id) { - return true; - } - if ( - authProfile?.username && - profile.username && - authProfile.username.toLowerCase() === - profile.username.toLowerCase() - ) { - return true; - } - } - return false; - })(); - - if (!profileMatchesCurrentTarget) { + if (!targetKey || lastLoadedKeyRef.current !== targetKey) { setLoading(true); }