Ensure listItem is exposed for set/unset custom variables handler (#2813)

This commit is contained in:
Sherfin Shamsudeen 2022-04-13 15:42:00 +05:30 committed by GitHub
parent fb3465581e
commit fda71f04e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -290,26 +290,26 @@ function executeAction(_ref, event, mode, customVariables) {
case 'set-custom-variable': {
const key = resolveReferences(event.key, _ref.state.currentState, undefined, customVariables);
const value = resolveReferences(event.value, _ref.state.currentState, undefined, customVariables);
const customVariables = { ..._ref.state.currentState.variables };
customVariables[key] = value;
const customAppVariables = { ..._ref.state.currentState.variables };
customAppVariables[key] = value;
return _ref.setState({
currentState: {
..._ref.state.currentState,
variables: customVariables,
variables: customAppVariables,
},
});
}
case 'unset-custom-variable': {
const key = resolveReferences(event.key, _ref.state.currentState, undefined, customVariables);
const customVariables = { ..._ref.state.currentState.variables };
delete customVariables[key];
const customAppVariables = { ..._ref.state.currentState.variables };
delete customAppVariables[key];
return _ref.setState({
currentState: {
..._ref.state.currentState,
variables: customVariables,
variables: customAppVariables,
},
});
}