Skip to content

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

Force a browser refresh upon project successfully built

Joshen Lim5278bbd30404
diff --git a/studio/components/layouts/ProjectLayout/ProjectLayout.tsx b/studio/components/layouts/ProjectLayout/ProjectLayout.tsx
index d478e6ca55d..d232be0baf3 100644
--- a/studio/components/layouts/ProjectLayout/ProjectLayout.tsx
+++ b/studio/components/layouts/ProjectLayout/ProjectLayout.tsx
@@ -23,7 +23,7 @@ interface Props {
hideIconBar?: boolean
}
-const BaseLayout: FC<Props> = ({
+const ProjectLayout: FC<Props> = ({
title,
isLoading = false,
product = '',
@@ -88,4 +88,4 @@ const BaseLayout: FC<Props> = ({
)
}
-export default observer(BaseLayout)
+export default observer(ProjectLayout)
diff --git a/studio/pages/project/[ref]/building.tsx b/studio/pages/project/[ref]/building.tsx
index 5217b5aad7d..75e2e84f99c 100644
--- a/studio/pages/project/[ref]/building.tsx
+++ b/studio/pages/project/[ref]/building.tsx
@@ -3,16 +3,16 @@ import { useRouter } from 'next/router'
import { observer } from 'mobx-react-lite'
import { useStore, withAuth } from 'hooks'
-import BaseLayout from 'components/layouts'
+import ProjectLayout from 'components/layouts'
type ProjectBuildingPageState = {} & any
const ProjectBuildingPage: React.FC<ProjectBuildingPageState> = () => {
const { ui } = useStore()
const project: any = ui.selectedProject
return (
- <BaseLayout title="Project Building">
+ <ProjectLayout title="Project Building">
<RedirectToDashboard projectRef={project?.ref ?? ''} />
- </BaseLayout>
+ </ProjectLayout>
)
}
export default withAuth(observer(ProjectBuildingPage))
@@ -24,7 +24,10 @@ const RedirectToDashboard: React.FC<RedirectToDashboardState> = ({ projectRef })
const router = useRouter()
React.useEffect(() => {
- router.push(`/project/${projectRef}`)
+ // Use redirect to reload store data properly after project has been
+ // been created or unpaused, this is necessarily especially for unpausing
+ // so that the dashboard fetches the updated connection strings
+ window.location.replace(`/project/${projectRef}`)
}, [])
return null
}