Skip to content

Commit

Permalink
Fix MDS bug
Browse files Browse the repository at this point in the history
Signed-off-by: saimedhi <[email protected]>
  • Loading branch information
saimedhi committed Dec 12, 2024
1 parent 72c32e6 commit 4790917
Showing 1 changed file with 27 additions and 18 deletions.
45 changes: 27 additions & 18 deletions public/pages/workflows/workflows.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,15 @@ export function Workflows(props: WorkflowsProps) {
// If the user navigates back to the manage tab, re-fetch workflows
useEffect(() => {
if (selectedTabId === WORKFLOWS_TAB.MANAGE) {
dispatch(
searchWorkflows({
apiBody: FETCH_ALL_QUERY,
dataSourceId: dataSourceId,
})
);
// wait until selected data source is ready before doing dispatch calls if mds is enabled
if (!dataSourceEnabled || (dataSourceId && dataSourceId !== '')) {
dispatch(
searchWorkflows({
apiBody: FETCH_ALL_QUERY,
dataSourceId: dataSourceId,
})
);
}
}
}, [selectedTabId]);

Expand All @@ -138,12 +141,15 @@ export function Workflows(props: WorkflowsProps) {

// On initial render: fetch all workflows
useEffect(() => {
dispatch(
searchWorkflows({
apiBody: FETCH_ALL_QUERY,
dataSourceId: dataSourceId,
})
);
// wait until selected data source is ready before doing dispatch calls if mds is enabled
if (!dataSourceEnabled || (dataSourceId && dataSourceId !== '')) {
dispatch(
searchWorkflows({
apiBody: FETCH_ALL_QUERY,
dataSourceId: dataSourceId,
})
);
}
}, []);

useEffect(() => {
Expand All @@ -158,12 +164,15 @@ export function Workflows(props: WorkflowsProps) {
search: queryString.stringify(updatedParams),
});
}
dispatch(
searchWorkflows({
apiBody: FETCH_ALL_QUERY,
dataSourceId: dataSourceId,
})
);
// wait until selected data source is ready before doing dispatch calls if mds is enabled
if (!dataSourceEnabled || (dataSourceId && dataSourceId !== '')) {
dispatch(
searchWorkflows({
apiBody: FETCH_ALL_QUERY,
dataSourceId: dataSourceId,
})
);
}
}, [dataSourceId, setDataSourceId]);

const handleDataSourceChange = ([event]: DataSourceOption[]) => {
Expand Down

0 comments on commit 4790917

Please sign in to comment.