Skip to content

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

fix: use isLoaded in stores

Jonathan Summers-Muirdae4aeac09e7
diff --git a/studio/components/interfaces/Functions/FunctionLayout.tsx b/studio/components/interfaces/Functions/FunctionLayout.tsx
index cb3793c95b7..24a3d5d4fd5 100644
--- a/studio/components/interfaces/Functions/FunctionLayout.tsx
+++ b/studio/components/interfaces/Functions/FunctionLayout.tsx
@@ -20,7 +20,7 @@ const PageLayout = ({ children }: { children?: React.ReactNode }) => {
functions.load()
}, [ui.selectedProject])
- if (!functions.list()) {
+ if (!functions.isLoaded) {
return (
<BaseLayout>
<Loading active={true}>loading</Loading>
diff --git a/studio/components/interfaces/Functions/FunctionsLayout.tsx b/studio/components/interfaces/Functions/FunctionsLayout.tsx
index 8483684873e..6fa68e99e36 100644
--- a/studio/components/interfaces/Functions/FunctionsLayout.tsx
+++ b/studio/components/interfaces/Functions/FunctionsLayout.tsx
@@ -19,7 +19,7 @@ const PageLayout = ({ children, centered }: { children?: React.ReactNode; center
functions.load()
}, [ui.selectedProject])
- if (!functions.isInitialized) {
+ if (!functions.isLoaded) {
return (
<BaseLayout>
<Loading active={true}>loading</Loading>
diff --git a/studio/components/layouts/LogsExplorerLayout/LogsExplorerLayout.tsx b/studio/components/layouts/LogsExplorerLayout/LogsExplorerLayout.tsx
index 9c3e96e4bb2..cbf99c9a405 100644
--- a/studio/components/layouts/LogsExplorerLayout/LogsExplorerLayout.tsx
+++ b/studio/components/layouts/LogsExplorerLayout/LogsExplorerLayout.tsx
@@ -18,7 +18,7 @@ const PageLayout = ({
content.load()
}, [ui.selectedProject])
- if (!content.isInitialized) {
+ if (!content.isLoaded) {
return (
<BaseLayout>
<Loading active={true}>loading</Loading>
diff --git a/studio/stores/content/ProjectContentStore.ts b/studio/stores/content/ProjectContentStore.ts
index 05318375f6e..1c8fddff0ad 100644
--- a/studio/stores/content/ProjectContentStore.ts
+++ b/studio/stores/content/ProjectContentStore.ts
@@ -54,7 +54,7 @@ export default class ProjectContentStore implements IProjectContentStore {
}
get isLoaded() {
- return this.state !== this.STATES.LOADED
+ return this.state === this.STATES.LOADED
}
async fetchData() {
diff --git a/studio/stores/functions/ProjectFunctionsStore.ts b/studio/stores/functions/ProjectFunctionsStore.ts
index d848c7ce111..72cb7930998 100644
--- a/studio/stores/functions/ProjectFunctionsStore.ts
+++ b/studio/stores/functions/ProjectFunctionsStore.ts
@@ -54,7 +54,7 @@ export default class ProjectFunctionsStore implements IProjectFunctionsStore {
}
get isLoaded() {
- return this.state !== this.STATES.LOADED
+ return this.state === this.STATES.LOADED
}
async fetchData() {