Hide state bindings if feature is not available
This commit is contained in:
parent
dbbcf4052e
commit
5d1be13c42
|
@ -266,12 +266,16 @@ const getDeviceBindings = () => {
|
||||||
* Gets all state bindings that are globally available.
|
* Gets all state bindings that are globally available.
|
||||||
*/
|
*/
|
||||||
const getStateBindings = () => {
|
const getStateBindings = () => {
|
||||||
const safeState = makePropSafe("state")
|
let bindings = []
|
||||||
return getAllStateVariables().map(key => ({
|
if (get(store).clientFeatures?.state) {
|
||||||
type: "context",
|
const safeState = makePropSafe("state")
|
||||||
runtimeBinding: `${safeState}.${makePropSafe(key)}`,
|
bindings = getAllStateVariables().map(key => ({
|
||||||
readableBinding: `State.${key}`,
|
type: "context",
|
||||||
}))
|
runtimeBinding: `${safeState}.${makePropSafe(key)}`,
|
||||||
|
readableBinding: `State.${key}`,
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
return bindings
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue