diff --git a/frontend/src/Editor/Viewer.jsx b/frontend/src/Editor/Viewer.jsx index 543fa8c427..34e405ed97 100644 --- a/frontend/src/Editor/Viewer.jsx +++ b/frontend/src/Editor/Viewer.jsx @@ -69,7 +69,6 @@ class ViewerComponent extends React.Component { isLoading: true, users: null, appDefinition: { pages: {} }, - queryConfirmationList: [], isAppLoaded: false, errorAppId: null, errorVersionId: null, @@ -418,6 +417,9 @@ class ViewerComponent extends React.Component { } }; + updateQueryConfirmationList = (queryConfirmationList) => + useEditorStore.getState().actions.updateQueryConfirmationList(queryConfirmationList); + componentDidMount() { this.setupViewer(); const isMobileDevice = this.state.deviceWindowWidth < 600; @@ -548,16 +550,15 @@ class ViewerComponent extends React.Component { }; handleEvent = (eventName, events, options) => { - const { appDefinition, queryConfirmationList, currentPageId } = this.state; + const { appDefinition, currentPageId } = this.state; const viewerRef = { appDefinition: appDefinition, - queryConfirmationList: queryConfirmationList, - updateQueryConfirmationList: null, + queryConfirmationList: this.props.queryConfirmationList, + updateQueryConfirmationList: this.updateQueryConfirmationList, navigate: this.props.navigate, switchPage: this.switchPage, currentPageId: currentPageId, }; - onEvent(viewerRef, eventName, events, options, 'view'); }; @@ -586,7 +587,6 @@ class ViewerComponent extends React.Component { deviceWindowWidth, defaultComponentStateComputed, dataQueries, - queryConfirmationList, errorAppId, errorVersionId, errorDetails, @@ -597,6 +597,8 @@ class ViewerComponent extends React.Component { const canvasMaxWidth = this.computeCanvasMaxWidth(); + const queryConfirmationList = this.props.queryConfirmationList; + if (this.state.app?.isLoading) { return (