mirror of
https://github.com/supabase/supabase.git
synced 2026-10-12 12:55:06 +03:00
updated orgs and page loading
This commit is contained in:
1 parent
a24cd5a777
commit
51645a6483
1 file changed
+11
-3
@@ -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 = () => {
|
||||
)}
|
||||
|
||||
<div className="grid gap-4 md:grid-cols-2 lg:grid-cols-3">
|
||||
{isLoading && (
|
||||
{isPageLoading && (
|
||||
<>
|
||||
<Skeleton className="h-[70px] rounded-md" />
|
||||
<Skeleton className="h-[70px] rounded-md" />
|
||||
|
||||
Reference in new issue
Block a user