diff --git a/apps/studio/components/layouts/ProjectSettingsLayout/SettingsLayout.tsx b/apps/studio/components/layouts/ProjectSettingsLayout/SettingsLayout.tsx index 422b1d34784..72937b8a775 100644 --- a/apps/studio/components/layouts/ProjectSettingsLayout/SettingsLayout.tsx +++ b/apps/studio/components/layouts/ProjectSettingsLayout/SettingsLayout.tsx @@ -1,11 +1,12 @@ import { useIsFeatureEnabled, useSelectedOrganization, useSelectedProject, withAuth } from 'hooks' import { useRouter } from 'next/router' -import { PropsWithChildren } from 'react' +import { PropsWithChildren, useEffect } from 'react' import { generateSettingsMenu } from './SettingsMenu.utils' import { useParams } from 'common' import { ProductMenu } from 'components/ui/ProductMenu' import { ProjectLayout } from '..' +import { IS_PLATFORM } from 'lib/constants' interface SettingsLayoutProps { title?: string @@ -17,6 +18,12 @@ const SettingsLayout = ({ title, children }: PropsWithChildren { + if (!IS_PLATFORM) { + router.push('/project/default') + } + }, [router]) + // billing pages live under /billing/invoices and /billing/subscription, etc // so we need to pass the [5]th part of the url to the menu const page = router.pathname.includes('billing')