1
0
Fork 0
mirror of synced 2024-06-15 17:05:11 +12:00

Hide state bindings if feature is not available

This commit is contained in:
Andrew Kingston 2021-09-02 11:39:41 +01:00
parent dbbcf4052e
commit 5d1be13c42

View file

@ -266,12 +266,16 @@ const getDeviceBindings = () => {
* Gets all state bindings that are globally available.
*/
const getStateBindings = () => {
const safeState = makePropSafe("state")
return getAllStateVariables().map(key => ({
type: "context",
runtimeBinding: `${safeState}.${makePropSafe(key)}`,
readableBinding: `State.${key}`,
}))
let bindings = []
if (get(store).clientFeatures?.state) {
const safeState = makePropSafe("state")
bindings = getAllStateVariables().map(key => ({
type: "context",
runtimeBinding: `${safeState}.${makePropSafe(key)}`,
readableBinding: `State.${key}`,
}))
}
return bindings
}
/**