Fix issue with getting environment details

This commit is contained in:
Andrew Kingston 2022-10-24 09:13:05 +01:00
parent 32bac91dc7
commit a11854d957
2 changed files with 3 additions and 1 deletions

View File

@ -47,7 +47,7 @@ const loadBudibase = async () => {
appStore.actions.setAppId(window["##BUDIBASE_APP_ID##"])
// Fetch environment info
if (!get(environmentStore)) {
if (!get(environmentStore)?.loaded) {
await environmentStore.actions.fetchEnvironment()
}

View File

@ -2,6 +2,7 @@ import { API } from "api"
import { writable } from "svelte/store"
const initialState = {
loaded: false,
cloud: false,
}
@ -15,6 +16,7 @@ const createEnvironmentStore = () => {
store.set({
...initialState,
...environment,
loaded: true,
})
} catch (error) {
store.set(initialState)