mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-24 09:28:31 +00:00
Fix/query state issue (#10531)
* add consume state directly from store instead of param when currentState store initialises * add consume state directly from store instead of param when currentState store initialises
This commit is contained in:
parent
795c925b54
commit
5bb033f7e3
1 changed files with 10 additions and 8 deletions
|
|
@ -106,16 +106,18 @@ useCurrentStateStore.subscribe((state) => {
|
||||||
|
|
||||||
handleLowPriorityWork(
|
handleLowPriorityWork(
|
||||||
() => {
|
() => {
|
||||||
|
const currentState = useCurrentStateStore.getState();
|
||||||
useResolveStore.getState().actions.addAppSuggestions(
|
useResolveStore.getState().actions.addAppSuggestions(
|
||||||
{
|
{
|
||||||
queries: state.queries,
|
// get state directly to prevent consuming stale data
|
||||||
components: !isPageSwitched ? state.components : {},
|
queries: currentState.queries,
|
||||||
globals: state.globals,
|
components: !isPageSwitched ? currentState.components : {},
|
||||||
page: state.page,
|
globals: currentState.globals,
|
||||||
variables: state.variables,
|
page: currentState.page,
|
||||||
client: state.client,
|
variables: currentState.variables,
|
||||||
server: state.server,
|
client: currentState.client,
|
||||||
constants: state.constants,
|
server: currentState.server,
|
||||||
|
constants: currentState.constants,
|
||||||
},
|
},
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue