diff --git a/frontend/src/Editor/EditorFunc.jsx b/frontend/src/Editor/EditorFunc.jsx index 693954cf94..47d74529ae 100644 --- a/frontend/src/Editor/EditorFunc.jsx +++ b/frontend/src/Editor/EditorFunc.jsx @@ -202,7 +202,7 @@ const EditorComponent = (props) => { // Ref to store the previous appDefinition for comparison useEffect(() => { - if (currentUser?.current_organization_id) { + if (mounted && currentUser?.current_organization_id) { fetchGlobalDataSources(); } // eslint-disable-next-line react-hooks/exhaustive-deps @@ -489,7 +489,6 @@ const EditorComponent = (props) => { props.switchDarkMode(newMode); }; - //! Needs attention const handleEvent = (eventName, event, options) => { return onEvent(editorRef, eventName, event, options, 'edit'); }; @@ -672,6 +671,7 @@ const EditorComponent = (props) => { await fetchDataSources(data.editing_version?.id); await fetchDataQueries(data.editing_version?.id, true, true); + await fetchGlobalDataSources(); const currentPageEvents = data.events.filter((event) => event.target === 'page' && event.sourceId === homePageId); diff --git a/frontend/src/Editor/Inspector/EventManager.jsx b/frontend/src/Editor/Inspector/EventManager.jsx index 98e8e00d27..a7875cfa9f 100644 --- a/frontend/src/Editor/Inspector/EventManager.jsx +++ b/frontend/src/Editor/Inspector/EventManager.jsx @@ -487,7 +487,7 @@ export const EventManager = ({ options={dataQueries .filter((qry) => isQueryRunnable(qry)) .map((qry) => ({ name: qry.name, value: qry.id }))} - value={event.queryId} + value={event?.queryId} search={true} onChange={(value) => { const query = dataQueries.find((dataquery) => dataquery.id === value); @@ -898,7 +898,12 @@ export const EventManager = ({ if (typeof popOverCallback === 'function') popOverCallback(showing); }} > -