don't load env vars when license isn't enabled
This commit is contained in:
parent
99287b9a5a
commit
2320bd574e
1 changed files with 10 additions and 7 deletions
|
@ -1,6 +1,7 @@
|
||||||
import { writable } from "svelte/store"
|
import { writable, get } from "svelte/store"
|
||||||
import { API } from "api"
|
import { API } from "api"
|
||||||
import { Constants } from "@budibase/frontend-core"
|
import { Constants } from "@budibase/frontend-core"
|
||||||
|
import { licensing } from "stores/portal"
|
||||||
|
|
||||||
export function createEnvironmentStore() {
|
export function createEnvironmentStore() {
|
||||||
const { subscribe, update } = writable({
|
const { subscribe, update } = writable({
|
||||||
|
@ -17,12 +18,14 @@ export function createEnvironmentStore() {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function loadVariables() {
|
async function loadVariables() {
|
||||||
const envVars = await API.fetchEnvironmentVariables()
|
if (get(licensing).environmentVariablesEnabled) {
|
||||||
const mappedVars = envVars.variables.map(name => ({ name }))
|
const envVars = await API.fetchEnvironmentVariables()
|
||||||
update(store => {
|
const mappedVars = envVars.variables.map(name => ({ name }))
|
||||||
store.variables = mappedVars
|
update(store => {
|
||||||
return store
|
store.variables = mappedVars
|
||||||
})
|
return store
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function createVariable(data) {
|
async function createVariable(data) {
|
||||||
|
|
Loading…
Reference in a new issue