Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

fix: Cannot access list projects on self-host (#21748)

Austin Tran2f4cb194ed5a
diff --git a/apps/studio/components/interfaces/Home/ProjectList/ProjectCard.tsx b/apps/studio/components/interfaces/Home/ProjectList/ProjectCard.tsx
index 36741d0d1b0..bfc8edc5481 100644
--- a/apps/studio/components/interfaces/Home/ProjectList/ProjectCard.tsx
+++ b/apps/studio/components/interfaces/Home/ProjectList/ProjectCard.tsx
@@ -26,7 +26,7 @@ const ProjectCard = ({
const { name, ref: projectRef } = project
const desc = `${project.cloud_provider} | ${project.region}`
- const isBranchingEnabled = project.preview_branch_refs.length > 0
+ const isBranchingEnabled = project.preview_branch_refs?.length > 0
const isGithubIntegrated = githubIntegration !== undefined
const isVercelIntegrated = vercelIntegration !== undefined
const githubRepository = githubIntegration?.metadata.name ?? undefined
diff --git a/apps/studio/components/layouts/AccountLayout/AccountLayout.tsx b/apps/studio/components/layouts/AccountLayout/AccountLayout.tsx
index 9ff40c78187..58df7e7a6ee 100644
--- a/apps/studio/components/layouts/AccountLayout/AccountLayout.tsx
+++ b/apps/studio/components/layouts/AccountLayout/AccountLayout.tsx
@@ -1,6 +1,6 @@
import Head from 'next/head'
import { useRouter } from 'next/router'
-import { PropsWithChildren } from 'react'
+import { PropsWithChildren, useEffect } from 'react'
import { useOrganizationsQuery } from 'data/organizations/organizations-query'
import { useFlag, useSelectedOrganization, withAuth } from 'hooks'
@@ -31,6 +31,12 @@ const AccountLayout = ({ children, title, breadcrumbs }: PropsWithChildren<Accou
await router.push('/sign-in')
}
+ useEffect(() => {
+ if (!IS_PLATFORM) {
+ router.push('/project/default')
+ }
+ }, [router])
+
const organizationsLinks = (organizations ?? [])
.map((organization) => ({
isActive: