don't load env vars when license isn't enabled
This commit is contained in:
parent
99287b9a5a
commit
2320bd574e
|
@ -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,6 +18,7 @@ export function createEnvironmentStore() {
|
|||
}
|
||||
|
||||
async function loadVariables() {
|
||||
if (get(licensing).environmentVariablesEnabled) {
|
||||
const envVars = await API.fetchEnvironmentVariables()
|
||||
const mappedVars = envVars.variables.map(name => ({ name }))
|
||||
update(store => {
|
||||
|
@ -24,6 +26,7 @@ export function createEnvironmentStore() {
|
|||
return store
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
async function createVariable(data) {
|
||||
await API.createEnvironmentVariable(data)
|
||||
|
|
Loading…
Reference in New Issue