From 51645a6483d228f92a4dc26d7cbfed0fc431a95a Mon Sep 17 00:00:00 2001 From: Ali Waseem Date: Thu, 13 Nov 2025 08:52:07 -0500 Subject: [PATCH] updated orgs and page loading --- apps/studio/pages/organizations.tsx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/apps/studio/pages/organizations.tsx b/apps/studio/pages/organizations.tsx index 43db22dcb42..6b85dbcf4ad 100644 --- a/apps/studio/pages/organizations.tsx +++ b/apps/studio/pages/organizations.tsx @@ -32,9 +32,15 @@ const OrganizationsPage: NextPageWithLayout = () => { const { error: orgNotFoundError, org: orgSlug } = useParams() const orgNotFound = orgNotFoundError === 'org_not_found' - const { profile } = useProfile() + const { profile, isLoading: isProfileLoading } = useProfile() - const { data: organizations = [], error, isLoading, isError, isSuccess } = useOrganizationsQuery() + const { + data: organizations = [], + error, + isLoading: isOrgsLoading, + isError, + isSuccess, + } = useOrganizationsQuery() const organizationCreationEnabled = useIsFeatureEnabled('organizations:create') const filteredOrganizations = @@ -44,6 +50,8 @@ const OrganizationsPage: NextPageWithLayout = () => { (x) => x.name.toLowerCase().includes(search) || x.slug.toLowerCase().includes(search) ) + const isPageLoading = isOrgsLoading || isProfileLoading + useEffect(() => { // If there are no organizations and the user has a profile, force the user to create one // unless the user is on the not found page @@ -97,7 +105,7 @@ const OrganizationsPage: NextPageWithLayout = () => { )}
- {isLoading && ( + {isPageLoading && ( <>