From dae4aeac09e7d6436cff92ec1498138fe3bc97f7 Mon Sep 17 00:00:00 2001 From: Jonathan Summers-Muir Date: Wed, 30 Mar 2022 21:31:16 +0200 Subject: [PATCH] fix: use isLoaded in stores --- studio/components/interfaces/Functions/FunctionLayout.tsx | 2 +- studio/components/interfaces/Functions/FunctionsLayout.tsx | 2 +- .../layouts/LogsExplorerLayout/LogsExplorerLayout.tsx | 2 +- studio/stores/content/ProjectContentStore.ts | 2 +- studio/stores/functions/ProjectFunctionsStore.ts | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) 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 ( 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 ( 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 ( 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() {