From d9868d02297ff09faf5ddb2e1018924dbd1638bc Mon Sep 17 00:00:00 2001 From: balibabu Date: Fri, 12 Jul 2024 23:39:07 +0800 Subject: [PATCH] fix: fixed the issue where the greeting message could not be displayed when opening the debug window #918 (#1499) ### What problem does this PR solve? fix: fixed the issue where the greeting message could not be displayed when opening the debug window #918 ### Type of change - [ ] Bug Fix (non-breaking change which fixes an issue) --- web/src/hooks/flow-hooks.ts | 1 + web/src/pages/flow/hooks.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/web/src/hooks/flow-hooks.ts b/web/src/hooks/flow-hooks.ts index cfdc09be9..8bf289d8e 100644 --- a/web/src/hooks/flow-hooks.ts +++ b/web/src/hooks/flow-hooks.ts @@ -95,6 +95,7 @@ export const useFetchFlow = (): { initialData: {} as IFlow, refetchOnReconnect: false, refetchOnMount: false, + refetchOnWindowFocus: false, queryFn: async () => { const { data } = await flowService.getCanvas({}, id); diff --git a/web/src/pages/flow/hooks.ts b/web/src/pages/flow/hooks.ts index 390844ea3..9269cae06 100644 --- a/web/src/pages/flow/hooks.ts +++ b/web/src/pages/flow/hooks.ts @@ -374,12 +374,12 @@ export const useSaveGraphBeforeOpeningDebugDrawer = (show: () => void) => { const resetRet = await resetFlow(); // After resetting, all previous messages will be cleared. if (resetRet?.retcode === 0) { - refetch(); // fetch prologue const sendRet = await send({ id }); if (receiveMessageError(sendRet)) { message.error(sendRet?.data?.retmsg); } else { + refetch(); show(); } }