mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-23 08:58:26 +00:00
Merge pull request #5247 from ToolJet/component-state-persists-duplicate-pages
Multipage: component and current state is persisted for duplicate pages
This commit is contained in:
commit
54a9cc378c
3 changed files with 4 additions and 1 deletions
|
|
@ -282,6 +282,7 @@ export const Box = function Box({
|
|||
{inCanvas ? (
|
||||
!resetComponent ? (
|
||||
<ComponentToRender
|
||||
key={`${id}${currentState.page.id}`}
|
||||
onComponentClick={onComponentClick}
|
||||
onComponentOptionChanged={onComponentOptionChanged}
|
||||
currentState={currentState}
|
||||
|
|
|
|||
|
|
@ -1622,7 +1622,7 @@ class EditorComponent extends React.Component {
|
|||
const { globals: existingGlobals } = this.state.currentState;
|
||||
|
||||
const page = {
|
||||
...this.state.currentState.page,
|
||||
id: pageId,
|
||||
name,
|
||||
handle,
|
||||
variables: this.state.pages?.[pageId]?.variables ?? {},
|
||||
|
|
|
|||
|
|
@ -154,6 +154,7 @@ class ViewerComponent extends React.Component {
|
|||
},
|
||||
variables: {},
|
||||
page: {
|
||||
id: currentPage.id,
|
||||
handle: currentPage.handle,
|
||||
name: currentPage.name,
|
||||
variables: {},
|
||||
|
|
@ -337,6 +338,7 @@ class ViewerComponent extends React.Component {
|
|||
name: targetPage.name,
|
||||
handle: targetPage.handle,
|
||||
variables: this.state.pages?.[pageIdCorrespondingToHandleOnURL]?.variables ?? {},
|
||||
id: pageIdCorrespondingToHandleOnURL,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue