Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ui): Fix workflow refresh bug #4906

Merged
merged 1 commit into from
Jan 19, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this guard was a bug

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