Skip to content

Commit 4319fe1

Browse files
authored
Fix redux state for s3 based connections (#3068)
1 parent c78b608 commit 4319fe1

File tree

2 files changed

+3
-32
lines changed

2 files changed

+3
-32
lines changed

src/ui/units/connections/components/Page/Page.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ import {
3636
getConnectors,
3737
setInitialState,
3838
setPageData,
39-
setRevision,
4039
updateConnectionWithRevision,
4140
} from '../../store';
4241
import {getConnItemByType} from '../../utils';
@@ -191,13 +190,7 @@ const PageComponent = (props: PageProps) => {
191190
workbookId,
192191
rev_id: revId,
193192
});
194-
//This is initial request data, there is no need to request it when changing revId
195-
// eslint-disable-next-line react-hooks/exhaustive-deps
196-
}, [actions, extractedEntryId, workbookId]);
197-
198-
React.useEffect(() => {
199-
actions.setRevision(revId);
200-
}, [revId, actions]);
193+
}, [actions, extractedEntryId, workbookId, revId]);
201194

202195
const setActualVersion = React.useMemo(
203196
() =>
@@ -308,7 +301,6 @@ const mapDispatchToProps = (dispatch: Dispatch) => {
308301
openDialogErrorWithTabs,
309302
openDialogSaveDraftChartAsActualConfirm,
310303
updateConnectionWithRevision,
311-
setRevision,
312304
},
313305
dispatch,
314306
),

src/ui/units/connections/store/actions/index.ts

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ interface GetConnectionDataRequestProps {
7878
flattenConnectors: ConnectorItem[];
7979
rev_id?: string;
8080
}
81-
export async function getConnectionDataRequest({
81+
82+
async function getConnectionDataRequest({
8283
entry,
8384
flattenConnectors,
8485
rev_id,
@@ -101,28 +102,6 @@ export async function getConnectionDataRequest({
101102
return {connectionData, connectionError};
102103
}
103104

104-
export function setRevision(revId?: string) {
105-
return async (dispatch: ConnectionsReduxDispatch, getState: GetState) => {
106-
const {
107-
connections: {flattenConnectors, entry},
108-
} = getState();
109-
if (entry) {
110-
dispatch(setPageLoading({pageLoading: true}));
111-
const {connectionData, connectionError} = await getConnectionDataRequest({
112-
entry,
113-
flattenConnectors,
114-
rev_id: revId,
115-
});
116-
batch(() => {
117-
dispatch(
118-
setConectorData({connectionData: connectionData ?? {}, error: connectionError}),
119-
);
120-
dispatch(setPageLoading({pageLoading: false}));
121-
});
122-
}
123-
};
124-
}
125-
126105
export function setPageData({
127106
entryId,
128107
workbookId,

0 commit comments

Comments
 (0)