From ab7d24def0ca1315c7ada109727885ec22f540bb Mon Sep 17 00:00:00 2001 From: Alex Collins Date: Tue, 19 Jan 2021 13:18:29 -0800 Subject: [PATCH] fix(ui): Fix workflow refresh bug 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]);