fixes: persisted state for components from duplicate pages

This commit is contained in:
arpitnath 2023-01-06 18:37:27 +05:30
parent b182fb7735
commit 71fcdfb6a4
2 changed files with 2 additions and 1 deletions

View file

@ -282,6 +282,7 @@ export const Box = function Box({
{inCanvas ? (
!resetComponent ? (
<ComponentToRender
key={`${id}${currentState.page.id}`}
onComponentClick={onComponentClick}
onComponentOptionChanged={onComponentOptionChanged}
currentState={currentState}

View file

@ -1622,10 +1622,10 @@ class EditorComponent extends React.Component {
const { globals: existingGlobals } = this.state.currentState;
const page = {
...this.state.currentState.page,
name,
handle,
variables: this.state.pages?.[pageId]?.variables ?? {},
id: pageId,
};
const globals = {