mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-24 01:18:23 +00:00
fixes: updates current state with page data on creating new page
This commit is contained in:
parent
31bdb456e5
commit
07e06486b2
1 changed files with 14 additions and 0 deletions
|
|
@ -1327,6 +1327,20 @@ const EditorComponent = (props) => {
|
|||
isSwitchingPage: true,
|
||||
},
|
||||
});
|
||||
|
||||
const { globals: existingGlobals } = currentState;
|
||||
|
||||
const page = {
|
||||
id: newPageId,
|
||||
name,
|
||||
handle,
|
||||
variables: copyOfAppDefinition.pages[newPageId]?.variables ?? {},
|
||||
};
|
||||
|
||||
const globals = {
|
||||
...existingGlobals,
|
||||
};
|
||||
useCurrentStateStore.getState().actions.setCurrentState({ globals, page });
|
||||
};
|
||||
|
||||
const switchPage = (pageId, queryParams = []) => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue