add actions suggestion for multi-line (#10362)

- on initial load and update of resolver state: create and add actions to suggestin service
This commit is contained in:
Arpit 2024-07-15 14:56:32 +05:30 committed by Kavin Venkatachalam
parent 68d9f172e3
commit a73fc45a27
2 changed files with 15 additions and 12 deletions

View file

@ -106,16 +106,19 @@ useCurrentStateStore.subscribe((state) => {
handleLowPriorityWork(
() => {
useResolveStore.getState().actions.addAppSuggestions({
queries: state.queries,
components: !isPageSwitched ? state.components : {},
globals: state.globals,
page: state.page,
variables: state.variables,
client: state.client,
server: state.server,
constants: state.constants,
});
useResolveStore.getState().actions.addAppSuggestions(
{
queries: state.queries,
components: !isPageSwitched ? state.components : {},
globals: state.globals,
page: state.page,
variables: state.variables,
client: state.client,
server: state.server,
constants: state.constants,
},
true
);
},
null,
isPageSwitched

View file

@ -102,10 +102,10 @@ export const useResolveStore = create(
updateLastUpdatedRefs: (updatedRefs) => {
set(() => ({ lastUpdatedRefs: updatedRefs }));
},
addAppSuggestions: (partialRefState) => {
addAppSuggestions: (partialRefState, intialLoad = false) => {
if (Object.keys(partialRefState).length === 0) return;
const { suggestionList, hintsMap, resolvedRefs } = createReferencesLookup(partialRefState);
const { suggestionList, hintsMap, resolvedRefs } = createReferencesLookup(partialRefState, false, intialLoad);
const _hintsMap = get().lookupTable.hints;
const resolvedRefsMap = get().lookupTable.resolvedRefs;