From 7d74dc24264d0665057dd4ac93e2235823530962 Mon Sep 17 00:00:00 2001 From: navaneeth Date: Mon, 17 May 2021 15:18:32 +0530 Subject: [PATCH] Fix for bug that causes overwritten app state --- frontend/src/_helpers/appUtils.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend/src/_helpers/appUtils.js b/frontend/src/_helpers/appUtils.js index 0eddcb915f..37ee3e8c82 100644 --- a/frontend/src/_helpers/appUtils.js +++ b/frontend/src/_helpers/appUtils.js @@ -96,18 +96,20 @@ function executeAction(_ref, event) { const modalId = event.options.modal; const modalMeta = _ref.state.appDefinition.components[modalId]; - _ref.setState({ + const newState = { currentState: { ..._ref.state.currentState, components: { - ..._ref.state.currentState, + ..._ref.state.currentState.components, [modalMeta.component.name]: { ..._ref.state.currentState.components[modalMeta.component.name], show: true } } } - }) + } + + _ref.setState(newState) } } }