diff --git a/frontend/src/_helpers/appUtils.js b/frontend/src/_helpers/appUtils.js index 5a72b603ad..a111e434b0 100644 --- a/frontend/src/_helpers/appUtils.js +++ b/frontend/src/_helpers/appUtils.js @@ -69,7 +69,7 @@ export function setCurrentStateAsync(_ref, changes) { }); } -const debouncedChange = _.debounce(() => { +const debouncedChange = _.debounce((duplicateCurrentState) => { const newComponentsState = {}; for (const [key, value] of Object.entries(getCurrentState().components)) { if (duplicateCurrentState[key]) { @@ -177,7 +177,7 @@ export function onComponentOptionsChanged(component, options, id) { duplicateCurrentState = { ...components, [componentName]: componentData }; - debouncedChange(); + debouncedChange(duplicateCurrentState); } return Promise.resolve(); } @@ -246,7 +246,7 @@ export function onComponentOptionChanged(component, option_name, value, id) { } else { // Update the duplicate state if editor is not ready duplicateCurrentState = { ...components, [componentName]: componentData }; - debouncedChange(); + debouncedChange(duplicateCurrentState); } return Promise.resolve();