From 8d89605bc6c1fcda0ae3d2d37353f7c76ed18ff6 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Mon, 16 Oct 2023 11:15:45 +0200 Subject: [PATCH] fix: fix previous ids for iterators and branches --- frontend/src/lib/components/flows/previousResults.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/src/lib/components/flows/previousResults.ts b/frontend/src/lib/components/flows/previousResults.ts index 9526acfb28..d8a66988b0 100644 --- a/frontend/src/lib/components/flows/previousResults.ts +++ b/frontend/src/lib/components/flows/previousResults.ts @@ -86,7 +86,11 @@ function getFlowInput( } export function getPreviousIds(id: string, flow: Flow, include_node: boolean): string[] { - const previousIds = dfs(id, flow, false) + const df = dfs(id, flow, false) + if (!include_node) { + df.shift() + } + return df .map((x) => { let submodules = getAllSubmodules(x) .flat() @@ -99,10 +103,6 @@ export function getPreviousIds(id: string, flow: Flow, include_node: boolean): s } }) .flat() - if (!include_node) { - previousIds.shift() - } - return previousIds } export function getStepPropPicker(