Fix issue with getting environment details
This commit is contained in:
parent
e6d5ef50c9
commit
9097b33fc9
|
@ -47,7 +47,7 @@ const loadBudibase = async () => {
|
||||||
appStore.actions.setAppId(window["##BUDIBASE_APP_ID##"])
|
appStore.actions.setAppId(window["##BUDIBASE_APP_ID##"])
|
||||||
|
|
||||||
// Fetch environment info
|
// Fetch environment info
|
||||||
if (!get(environmentStore)) {
|
if (!get(environmentStore)?.loaded) {
|
||||||
await environmentStore.actions.fetchEnvironment()
|
await environmentStore.actions.fetchEnvironment()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@ import { API } from "api"
|
||||||
import { writable } from "svelte/store"
|
import { writable } from "svelte/store"
|
||||||
|
|
||||||
const initialState = {
|
const initialState = {
|
||||||
|
loaded: false,
|
||||||
cloud: false,
|
cloud: false,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,6 +16,7 @@ const createEnvironmentStore = () => {
|
||||||
store.set({
|
store.set({
|
||||||
...initialState,
|
...initialState,
|
||||||
...environment,
|
...environment,
|
||||||
|
loaded: true,
|
||||||
})
|
})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
store.set(initialState)
|
store.set(initialState)
|
||||||
|
|
Loading…
Reference in New Issue