fixes: updates current state with page data on creating new page

This commit is contained in:
arpitnath 2023-10-26 11:59:48 +05:30
parent 31bdb456e5
commit 07e06486b2

View file

@ -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 = []) => {