mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
fix(editor): fix pairedItem
in combination with pinned data (#4257)
🐛 Fix `pairedItem` in combination with pinned data
This commit is contained in:
parent
a751fd3ce7
commit
e30c78febe
|
@ -78,6 +78,19 @@ export const workflowHelpers = mixins(
|
||||||
// which does not use the node name
|
// which does not use the node name
|
||||||
const parentNodeName = parentNode[0];
|
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;
|
const workflowRunData = this.$store.getters.getWorkflowRunData as IRunData | null;
|
||||||
if (workflowRunData === null) {
|
if (workflowRunData === null) {
|
||||||
return executeData;
|
return executeData;
|
||||||
|
|
|
@ -668,10 +668,18 @@ export class WorkflowDataProxy {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const previousNodeHasPinData =
|
||||||
|
sourceData && this.workflow.getPinDataOfNode(sourceData.previousNode) !== undefined;
|
||||||
|
|
||||||
let currentPairedItem = pairedItem;
|
let currentPairedItem = pairedItem;
|
||||||
|
|
||||||
let nodeBeforeLast: string | undefined;
|
let nodeBeforeLast: string | undefined;
|
||||||
while (sourceData !== null && destinationNodeName !== sourceData.previousNode) {
|
|
||||||
|
while (
|
||||||
|
!previousNodeHasPinData &&
|
||||||
|
sourceData !== null &&
|
||||||
|
destinationNodeName !== sourceData.previousNode
|
||||||
|
) {
|
||||||
taskData =
|
taskData =
|
||||||
that.runExecutionData!.resultData.runData[sourceData.previousNode][
|
that.runExecutionData!.resultData.runData[sourceData.previousNode][
|
||||||
sourceData?.previousNodeRun || 0
|
sourceData?.previousNodeRun || 0
|
||||||
|
|
Loading…
Reference in a new issue