diff --git a/src/ui/units/connections/components/Page/Page.tsx b/src/ui/units/connections/components/Page/Page.tsx index 6ebaf27d2e..4dacc571eb 100644 --- a/src/ui/units/connections/components/Page/Page.tsx +++ b/src/ui/units/connections/components/Page/Page.tsx @@ -36,7 +36,6 @@ import { getConnectors, setInitialState, setPageData, - setRevision, updateConnectionWithRevision, } from '../../store'; import {getConnItemByType} from '../../utils'; @@ -191,13 +190,7 @@ const PageComponent = (props: PageProps) => { workbookId, rev_id: revId, }); - //This is initial request data, there is no need to request it when changing revId - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [actions, extractedEntryId, workbookId]); - - React.useEffect(() => { - actions.setRevision(revId); - }, [revId, actions]); + }, [actions, extractedEntryId, workbookId, revId]); const setActualVersion = React.useMemo( () => @@ -305,7 +298,6 @@ const mapDispatchToProps = (dispatch: Dispatch) => { openDialogErrorWithTabs, openDialogSaveDraftChartAsActualConfirm, updateConnectionWithRevision, - setRevision, }, dispatch, ), diff --git a/src/ui/units/connections/store/actions/index.ts b/src/ui/units/connections/store/actions/index.ts index f0aaac7d3f..c63dd286cc 100644 --- a/src/ui/units/connections/store/actions/index.ts +++ b/src/ui/units/connections/store/actions/index.ts @@ -78,7 +78,8 @@ interface GetConnectionDataRequestProps { flattenConnectors: ConnectorItem[]; rev_id?: string; } -export async function getConnectionDataRequest({ + +async function getConnectionDataRequest({ entry, flattenConnectors, rev_id, @@ -101,28 +102,6 @@ export async function getConnectionDataRequest({ return {connectionData, connectionError}; } -export function setRevision(revId?: string) { - return async (dispatch: ConnectionsReduxDispatch, getState: GetState) => { - const { - connections: {flattenConnectors, entry}, - } = getState(); - if (entry) { - dispatch(setPageLoading({pageLoading: true})); - const {connectionData, connectionError} = await getConnectionDataRequest({ - entry, - flattenConnectors, - rev_id: revId, - }); - batch(() => { - dispatch( - setConectorData({connectionData: connectionData ?? {}, error: connectionError}), - ); - dispatch(setPageLoading({pageLoading: false})); - }); - } - }; -} - export function setPageData({ entryId, workbookId,