From 148dcfee06db77d28de58e198c9e545fa513a44d Mon Sep 17 00:00:00 2001 From: Ivan Li Date: Sun, 4 Apr 2021 10:44:30 +0800 Subject: [PATCH] =?UTF-8?q?fix(pipeline-tasks):=20=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E8=AF=A6=E6=83=85=20=E5=A4=9A=E6=AC=A1=E8=AE=A2=E9=98=85?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E5=8F=98=E5=8C=96=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pipeline-tasks/pipeline-task-details.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/components/pipeline-tasks/pipeline-task-details.tsx b/src/components/pipeline-tasks/pipeline-task-details.tsx index 4562b93..89bf51d 100644 --- a/src/components/pipeline-tasks/pipeline-task-details.tsx +++ b/src/components/pipeline-tasks/pipeline-task-details.tsx @@ -118,10 +118,14 @@ export const PipelineTaskDetails = ({ taskId }: Props) => { { taskId: string } >(FIND_PIPELINE_TASK, { variables: { taskId } }); - subscribeToMore({ - document: PIPELINE_TASK_CHANGED, - variables: { taskId } - }); + useMemo( + () => + subscribeToMore({ + document: PIPELINE_TASK_CHANGED, + variables: { taskId } + }), + [subscribeToMore, taskId] + ); const store = useLocalObservable(() => new Store());