From 12292b62a8ec6e01a6a1e55f81ae9c5024da22dd Mon Sep 17 00:00:00 2001 From: Usman Baig Date: Thu, 22 Jan 2026 18:36:03 +0100 Subject: [PATCH] refactor(loading): streamline LoadingOverlay usage in HomePage and AuthCallback to return null during loading states --- app/auth/callback/page.tsx | 4 ++-- app/page.tsx | 4 ++-- lib/auth/context.tsx | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/auth/callback/page.tsx b/app/auth/callback/page.tsx index f8c3fc0..fe8dbc4 100644 --- a/app/auth/callback/page.tsx +++ b/app/auth/callback/page.tsx @@ -110,12 +110,12 @@ function AuthCallbackContent() { } // * Use standard Pulse loading screen to make transition to Home seamless - return + return null } export default function AuthCallback() { return ( - }> + ) diff --git a/app/page.tsx b/app/page.tsx index 3d58d0a..e2be69a 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -12,7 +12,7 @@ export default function HomePage() { const { user, loading } = useAuth() if (loading) { - return + return null } if (!user) { @@ -91,7 +91,7 @@ export default function HomePage() { // * Wait for organization context before rendering SiteList to avoid "Organization Required" flash if (user && !user.org_id) { - return + return null } return ( diff --git a/lib/auth/context.tsx b/lib/auth/context.tsx index 3837d7c..49426bf 100644 --- a/lib/auth/context.tsx +++ b/lib/auth/context.tsx @@ -154,7 +154,7 @@ export function AuthProvider({ children }: { children: React.ReactNode }) { return ( - {isLoggingOut && } + {(loading || isLoggingOut) && } {children} )