1
0
Fork 0
mirror of synced 2024-07-15 11:15:59 +12:00

don't load env vars when license isn't enabled

This commit is contained in:
Peter Clement 2023-02-06 14:35:12 +00:00
parent 99287b9a5a
commit 2320bd574e

View file

@ -1,6 +1,7 @@
import { writable } from "svelte/store"
import { writable, get } from "svelte/store"
import { API } from "api"
import { Constants } from "@budibase/frontend-core"
import { licensing } from "stores/portal"
export function createEnvironmentStore() {
const { subscribe, update } = writable({
@ -17,12 +18,14 @@ export function createEnvironmentStore() {
}
async function loadVariables() {
const envVars = await API.fetchEnvironmentVariables()
const mappedVars = envVars.variables.map(name => ({ name }))
update(store => {
store.variables = mappedVars
return store
})
if (get(licensing).environmentVariablesEnabled) {
const envVars = await API.fetchEnvironmentVariables()
const mappedVars = envVars.variables.map(name => ({ name }))
update(store => {
store.variables = mappedVars
return store
})
}
}
async function createVariable(data) {