diff --git a/frontend/src/Editor/Viewer.jsx b/frontend/src/Editor/Viewer.jsx index 227a5079d3..419565eb3a 100644 --- a/frontend/src/Editor/Viewer.jsx +++ b/frontend/src/Editor/Viewer.jsx @@ -134,7 +134,7 @@ class ViewerComponent extends React.Component { if (dataQueries.length > 0) { dataQueries.forEach((query) => { - if (query?.options && query?.options?.runOnPageLoad) { + if (query?.options && query?.options?.requestConfirmation && query?.options?.runOnPageLoad) { queryConfirmationList.push({ queryId: query.id, queryName: query.name }); } diff --git a/frontend/src/_helpers/appUtils.js b/frontend/src/_helpers/appUtils.js index ca72f086fb..aadfc81472 100644 --- a/frontend/src/_helpers/appUtils.js +++ b/frontend/src/_helpers/appUtils.js @@ -341,7 +341,9 @@ export function onQueryConfirmOrCancel(_ref, queryConfirmationData, isConfirm = (query) => query.queryId !== queryConfirmationData.queryId ); - _ref.updateQueryConfirmationList(filtertedQueryConfirmation); + // console.log('---arpit:: dq', { filtertedQueryConfirmation }); + + _ref.updateQueryConfirmationList(filtertedQueryConfirmation, 'check'); isConfirm && runQuery(_ref, queryConfirmationData.queryId, queryConfirmationData.queryName, true, mode); } @@ -927,7 +929,7 @@ export function runQuery(_ref, queryId, queryName, confirmed = undefined, mode = const options = getQueryVariables(dataQuery.options, getCurrentState()); - if (dataQuery.options.requestConfirmation) { + if (dataQuery.options?.requestConfirmation) { const runOnPageLoad = dataQuery.options?.runOnPageLoad ?? false; const queryConfirmationList = runOnPageLoad ? _ref.queryConfirmationList : []; diff --git a/frontend/src/_stores/dataQueriesStore.js b/frontend/src/_stores/dataQueriesStore.js index 0d752e504d..557e690435 100644 --- a/frontend/src/_stores/dataQueriesStore.js +++ b/frontend/src/_stores/dataQueriesStore.js @@ -42,7 +42,7 @@ export const useDataQueriesStore = create( if (data.data_queries.length !== 0) { const queryConfirmationList = []; data.data_queries.forEach(({ id, name, options }) => { - if (options && options?.runOnPageLoad) { + if (options && options?.requestConfirmation && options?.runOnPageLoad) { queryConfirmationList.push({ queryId: id, queryName: name }); } });