fix(editor): Fix schema view showing incorrect data on loop node done branch (#15635)

This commit is contained in:
jeanpaul
2025-05-23 13:15:09 +02:00
committed by GitHub
parent 70ea7a8859
commit f762c59fb3
2 changed files with 141 additions and 2 deletions

View File

@@ -55,6 +55,7 @@ type Props = {
connectionType?: NodeConnectionType;
search?: string;
compact?: boolean;
outputIndex?: number;
};
const props = withDefaults(defineProps<Props>(), {
@@ -66,6 +67,7 @@ const props = withDefaults(defineProps<Props>(), {
search: '',
mappingEnabled: false,
compact: false,
outputIndex: undefined,
});
const telemetry = useTelemetry();
@@ -113,7 +115,14 @@ const getNodeSchema = async (fullNode: INodeUi, connectedNode: IConnectedNode) =
runIndex: getLastRunIndexWithData(fullNode.name, outputIndex, props.connectionType),
}))
.filter(({ runIndex }) => runIndex !== -1);
const nodeData = connectedOutputsWithData
// If outputIndex is specified, only use data from that specific output branch
const filteredOutputsWithData =
props.outputIndex !== undefined
? connectedOutputsWithData.filter(({ outputIndex }) => outputIndex === props.outputIndex)
: connectedOutputsWithData;
const nodeData = filteredOutputsWithData
.map(({ outputIndex, runIndex }) =>
getNodeInputData(fullNode, runIndex, outputIndex, props.paneType, props.connectionType),
)