From 23abccd3a66c19d1c866ae1e8eff8775c3120836 Mon Sep 17 00:00:00 2001 From: StyleZhang Date: Sun, 29 Sep 2024 14:43:00 +0800 Subject: [PATCH] fix: lint --- web/app/components/workflow/hooks/use-workflow.ts | 5 ++++- web/app/components/workflow/index.tsx | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/web/app/components/workflow/hooks/use-workflow.ts b/web/app/components/workflow/hooks/use-workflow.ts index b201b28b88..0e51ea0b37 100644 --- a/web/app/components/workflow/hooks/use-workflow.ts +++ b/web/app/components/workflow/hooks/use-workflow.ts @@ -439,7 +439,9 @@ export const useWorkflowInit = () => { const setSyncWorkflowDraftHash = useStore(s => s.setSyncWorkflowDraftHash) const [data, setData] = useState() const [isLoading, setIsLoading] = useState(true) - workflowStore.setState({ appId: appDetail.id }) + useEffect(() => { + workflowStore.setState({ appId: appDetail.id }) + }, [appDetail.id, workflowStore]) const handleGetInitialWorkflowData = useCallback(async () => { try { @@ -487,6 +489,7 @@ export const useWorkflowInit = () => { useEffect(() => { handleGetInitialWorkflowData() + // eslint-disable-next-line react-hooks/exhaustive-deps }, []) const handleFetchPreloadData = useCallback(async () => { diff --git a/web/app/components/workflow/index.tsx b/web/app/components/workflow/index.tsx index 53e9cf9aac..ed28291d69 100644 --- a/web/app/components/workflow/index.tsx +++ b/web/app/components/workflow/index.tsx @@ -177,6 +177,7 @@ const Workflow: FC = memo(({ return () => { handleSyncWorkflowDraft(true, true) } + // eslint-disable-next-line react-hooks/exhaustive-deps }, []) const { handleRefreshWorkflowDraft } = useWorkflowUpdate()