To Reproduce:
- Start with the ALL OF / ANY OF toggle set to ALL OF.
- Define some set of Keep Module Builder criteria (e.g. add some active conditions)
- Download the Keep.json file and inspect it: default state should have
states.Initial.conditional_transition[0].condition.condition_type == 'And'
- Return to the Keep Module Builder and toggle the ALL OF / ANY OF to the ANY OF state.
- Download the Keep.json file and inspect it:
states.Initial.conditional_transition[0].condition.condition_type should still be incorrectly And'
- Return to the Keep Module Builder and this time add a new criteria
- Download the Keep.json file and inspect it:
states.Initial.conditional_transition[0].condition.condition_type should now correctly be Or
Looks like the culprit is here: While addCurrrent will update the Keep state and keep module string, setAny does have the same side-effect.. Simplest fix would probably be to create a similar updateAnyAndKeeps method that gets called onClick of the toggle. You might want to debounce this as well - can be very addictive to click a toggle over and over again - to prevent the app slowing down.