fix(editor): fix pairedItem in combination with pinned data (#4257)

🐛 Fix `pairedItem` in combination with pinned data
This commit is contained in:
Iván Ovejero 2022-10-04 14:05:46 +02:00 committed by GitHub
parent a751fd3ce7
commit e30c78febe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 1 deletions

View file

@ -78,6 +78,19 @@ export const workflowHelpers = mixins(
// which does not use the node name
const parentNodeName = parentNode[0];
const parentPinData = this.$store.getters.pinData[parentNodeName];
// populate `executeData` from `pinData`
if (parentPinData) {
executeData.data = { main: [parentPinData] };
executeData.source = { main: [{ previousNode: parentNodeName }] };
return executeData;
}
// populate `executeData` from `runData`
const workflowRunData = this.$store.getters.getWorkflowRunData as IRunData | null;
if (workflowRunData === null) {
return executeData;

View file

@ -668,10 +668,18 @@ export class WorkflowDataProxy {
};
}
const previousNodeHasPinData =
sourceData && this.workflow.getPinDataOfNode(sourceData.previousNode) !== undefined;
let currentPairedItem = pairedItem;
let nodeBeforeLast: string | undefined;
while (sourceData !== null && destinationNodeName !== sourceData.previousNode) {
while (
!previousNodeHasPinData &&
sourceData !== null &&
destinationNodeName !== sourceData.previousNode
) {
taskData =
that.runExecutionData!.resultData.runData[sourceData.previousNode][
sourceData?.previousNodeRun || 0