Fixed toggled off spells showing in spell list

This commit is contained in:
Stefan Zermatten
2022-09-26 09:43:00 +02:00
parent 87f79737e8
commit d4b7d22b5f
2 changed files with 1 additions and 3 deletions

View File

@@ -10,8 +10,6 @@ export default function computeToggleDependencies(node, dependencyGraph){
prop.enabled
) return;
walkDown(node.children, child => {
// Only for children that aren't inactive
if (child.node.inactive) return;
// The child nodes depend on the toggle condition compuation
child.node._computationDetails.toggleAncestors.push(prop);
dependencyGraph.addLink(child.node._id, prop._id, 'toggle');

View File

@@ -4,7 +4,7 @@ export default function evaluateToggles(computation, node){
let toggles = prop._computationDetails?.toggleAncestors;
if (!toggles) return;
toggles.forEach(toggle => {
if (prop.inactive || !toggle.condition) return;
if (!toggle.condition) return;
if (!toggle.condition.value){
prop.inactive = true;
prop.deactivatedByToggle = true;