Constants should now respect toggles

This commit is contained in:
Stefan Zermatten
2021-03-01 11:42:23 +02:00
parent 3517636b8b
commit 7283a27727
3 changed files with 13 additions and 2 deletions

View File

@@ -71,8 +71,8 @@ function replaceConstants({calc, memo, prop, dependencies, context}){
} else if (node.name === '#constant'){
constant = findAncestorByType({type: 'constant', prop, memo});
}
// replace constants that aren't overridden by stats
if (constant && !stat){
// replace constants that aren't overridden by stats or disabled by a toggle
if (constant && !constant.deactivatedByToggle && !stat){
dependencies = union(dependencies, [
constant._id,
...constant.dependencies