fix: Passed the correct app value to the preview query and autoLayout

This commit is contained in:
Kavin Venkatachalam 2025-06-11 15:29:18 +05:30
parent 1d15cddbfd
commit 6bdc165ba2
2 changed files with 5 additions and 2 deletions

View file

@ -1527,7 +1527,8 @@ export const createComponentsSlice = (set, get) => ({
},
turnOffAutoComputeLayout: async (moduleId = 'canvas') => {
const { app, getCurrentPageId, currentVersionId } = get();
const { appStore, getCurrentPageId, currentVersionId } = get();
const app = appStore.modules[moduleId].app;
const currentPageId = getCurrentPageId(moduleId);
set(
(state) => {

View file

@ -539,7 +539,7 @@ export const createQueryPanelSlice = (set, get) => ({
},
previewQuery: (query, calledFromQuery = false, userSuppliedParameters = {}, moduleId = 'canvas') => {
const { eventsSlice, queryPanel, app, currentVersionId, selectedEnvironment } = get();
const { eventsSlice, queryPanel, appStore, currentVersionId, selectedEnvironment } = get();
const {
queryPreviewData,
setPreviewLoading,
@ -563,6 +563,8 @@ export const createQueryPanelSlice = (set, get) => ({
let parameters = userSuppliedParameters;
const app = appStore.modules[moduleId].app;
// passing current env through props only for querymanager
const { environmentId } = app;
const currentAppEnvironmentId = selectedEnvironment?.id || '';