Skip to content

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

return found or undefined selectedproject after set (#11449)

Francisco Mazzonib3138a7af726
diff --git a/studio/stores/RootStore.ts b/studio/stores/RootStore.ts
index 6520c228b2e..3b42662f36d 100644
--- a/studio/stores/RootStore.ts
+++ b/studio/stores/RootStore.ts
@@ -83,7 +83,7 @@ export class RootStore implements IRootStore {
// - project not found yet. projectStore is loading
// - connectionString is not available. projectStore loaded
const found = this.app.projects.find((x: Project) => x.ref === value)
- if (!found || !found.connectionString) {
+ if (found?.connectionString === undefined) {
this.app.projects.fetchDetail(value, (project) => {
setProjectRefs(project)
})
diff --git a/studio/stores/UiStore.ts b/studio/stores/UiStore.ts
index d751e77b580..b9bbd8a9a4a 100644
--- a/studio/stores/UiStore.ts
+++ b/studio/stores/UiStore.ts
@@ -59,7 +59,8 @@ export default class UiStore implements IUiStore {
const found = this.rootStore.app.projects.find(
(x: Project) => x.ref === this.selectedProjectRef
)
- return !!found?.connectionString ? found : undefined
+ // Self-hosted project details has connectionString set to empty string
+ return found?.connectionString !== undefined ? found : undefined
}
return undefined
}