Toggles now wont apply tag targeting if deactivated
This commit is contained in:
@@ -5,8 +5,26 @@ export default function evaluateToggles(computation, node) {
|
|||||||
if (!toggles) return;
|
if (!toggles) return;
|
||||||
toggles.forEach(toggle => {
|
toggles.forEach(toggle => {
|
||||||
if (
|
if (
|
||||||
(!toggle.enabled && !toggle.disabled && toggle.condition && !toggle.condition.value)
|
(
|
||||||
|| (toggle.disabled)
|
// Toggle isn't set to constantly enabled or disabled
|
||||||
|
!toggle.enabled &&
|
||||||
|
!toggle.disabled &&
|
||||||
|
// Toggle is not disabled by another toggle targeting it
|
||||||
|
// Ancestor toggles would've handled this child anyway,
|
||||||
|
// and tag targeted toggles break the link
|
||||||
|
!toggle.deactivatedByToggle &&
|
||||||
|
!toggle.deactivatedByAncestor &&
|
||||||
|
// Toggle has a condition with a falsy value
|
||||||
|
toggle.condition &&
|
||||||
|
!toggle.condition.value
|
||||||
|
)
|
||||||
|
|| (
|
||||||
|
// Toggle is disabled manually
|
||||||
|
toggle.disabled &&
|
||||||
|
// Toggle isn't deactivated by something else
|
||||||
|
!toggle.deactivatedByToggle &&
|
||||||
|
!toggle.deactivatedByAncestor
|
||||||
|
)
|
||||||
) {
|
) {
|
||||||
prop.inactive = true;
|
prop.inactive = true;
|
||||||
prop.deactivatedByToggle = true;
|
prop.deactivatedByToggle = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user