From ee1f8276460b287da4df617b5c76a1e05764da3f Mon Sep 17 00:00:00 2001 From: Alex Collins Date: Tue, 19 Jan 2021 14:35:58 -0800 Subject: [PATCH] fix(ui): Fix workflow refresh bug (#4906) Signed-off-by: Alex Collins --- .../workflow-details/workflow-details.tsx | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/ui/src/app/workflows/components/workflow-details/workflow-details.tsx b/ui/src/app/workflows/components/workflow-details/workflow-details.tsx index 7e7498b34491..0ea56f0df265 100644 --- a/ui/src/app/workflows/components/workflow-details/workflow-details.tsx +++ b/ui/src/app/workflows/components/workflow-details/workflow-details.tsx @@ -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( - 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]);