From 682da3879a53edd2ed4b200af0b250a9b64819fb Mon Sep 17 00:00:00 2001 From: Rohit Date: Sat, 7 Jun 2025 14:50:28 +0530 Subject: [PATCH] feat: push list data at index position --- server/src/workflow-management/classes/Interpreter.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/server/src/workflow-management/classes/Interpreter.ts b/server/src/workflow-management/classes/Interpreter.ts index ca853489..f249f26e 100644 --- a/server/src/workflow-management/classes/Interpreter.ts +++ b/server/src/workflow-management/classes/Interpreter.ts @@ -107,6 +107,11 @@ export class WorkflowInterpreter { */ public binaryData: { mimetype: string, data: string }[] = []; + /** + * Track current scrapeList index + */ + private currentScrapeListIndex: number = 0; + /** * An array of id's of the pairs from the workflow that are about to be paused. * As "breakpoints". @@ -288,6 +293,7 @@ export class WorkflowInterpreter { scrapeList: [], }; this.binaryData = []; + this.currentScrapeListIndex = 0; } /** @@ -322,6 +328,9 @@ export class WorkflowInterpreter { }, setActionType: (type: string) => { this.currentActionType = type; + }, + incrementScrapeListIndex: () => { + this.currentScrapeListIndex++; } }, serializableCallback: (data: any) => { @@ -334,7 +343,7 @@ export class WorkflowInterpreter { this.serializableDataByType.scrapeSchema.push([data]); } } else if (this.currentActionType === 'scrapeList') { - this.serializableDataByType.scrapeList.push(data); + this.serializableDataByType.scrapeList[this.currentScrapeListIndex] = data; } this.socket.emit('serializableCallback', data);