Skip to content

Commit

Permalink
fix(ui): Fix workflow refresh bug (#4906)
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Collins <alex_collins@intuit.com>
  • Loading branch information
alexec committed Jan 19, 2021
1 parent 929cd50 commit ee1f827
Showing 1 changed file with 2 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,28 +173,13 @@ export const WorkflowDetails = ({history, location, match}: RouteComponentProps<
};

useEffect(() => {
services.workflows
.get(namespace, name)
.then(setWorkflow)
.catch(setError);
}, [namespace, name]);

useEffect(() => {
if (!workflow) {
return;
}
const retryWatch = new RetryWatch<Workflow>(
resourceVersion =>
services.workflows.watch({
name: workflow.metadata.name,
namespace: workflow.metadata.namespace,
resourceVersion
}),
() => services.workflows.watch({name, namespace}),
() => setError(null),
e => setWorkflow(e.object),
setError
);
retryWatch.start(workflow.metadata.resourceVersion);
retryWatch.start();
return () => retryWatch.stop();
}, [namespace, name]);

Expand Down

0 comments on commit ee1f827

Please sign in to comment.