From 3a1c176f4dad26993a54956d0b1e989949c3698a Mon Sep 17 00:00:00 2001 From: yu <191972707@qq.com> Date: Wed, 28 Oct 2026 16:04:44 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=88=87=E6=8D=A2=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E6=97=B6=E6=B8=85=E7=A9=BA=E8=BF=90=E8=A1=8C=E7=BB=93=E6=9E=9C?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=EF=BC=8C=E9=81=BF=E5=85=8D=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E4=B8=8A=E4=B8=80=E6=B5=81=E7=A8=8B=E7=9A=84=E8=BF=90=E8=A1=8C?= =?UTF-8?q?=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/store/editorStore.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/renderer/src/store/editorStore.ts b/src/renderer/src/store/editorStore.ts index 7fc31d4..1c2bf21 100644 --- a/src/renderer/src/store/editorStore.ts +++ b/src/renderer/src/store/editorStore.ts @@ -8,6 +8,7 @@ import type { FlowNodeOptions, FlowVariable } from "@shared/types"; +import { useRunStore } from "./runStore"; const clone = (value: T): T => structuredClone(value); @@ -111,7 +112,12 @@ export const useEditorStore = create((set, get) => { setCatalog: (catalog) => set({ catalog }), - loadFlow: (flow) => set({ flow, selectedNodeId: null, dirty: false, past: [], future: [] }), + loadFlow: (flow) => { + // 切换流程时清掉上一次的运行面板状态,避免显示旧流程的运行结果 + const runState = useRunStore.getState(); + if (!runState.running) runState.clear(); + set({ flow, selectedNodeId: null, dirty: false, past: [], future: [] }); + }, selectNode: (id) => set({ selectedNodeId: id }),