From eb160e9532b60f51e306b2abb6afc0afebeb5d63 Mon Sep 17 00:00:00 2001 From: centdix <40307056+centdix@users.noreply.github.com> Date: Tue, 16 Sep 2025 22:36:25 +0200 Subject: [PATCH] fix revert all issue (#6614) --- .../src/lib/components/copilot/chat/flow/FlowAIChat.svelte | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/src/lib/components/copilot/chat/flow/FlowAIChat.svelte b/frontend/src/lib/components/copilot/chat/flow/FlowAIChat.svelte index 7aade584f9..c81665cf60 100644 --- a/frontend/src/lib/components/copilot/chat/flow/FlowAIChat.svelte +++ b/frontend/src/lib/components/copilot/chat/flow/FlowAIChat.svelte @@ -99,8 +99,10 @@ } }, rejectAllModuleActions() { - for (const id of Object.keys(affectedModules)) { - this.revertModuleAction(id) + // Do it in reverse to revert nested modules first then parents + const ids = Object.keys(affectedModules) + for (let i = ids.length - 1; i >= 0; i--) { + this.revertModuleAction(ids[i]) } affectedModules = {} },