From 976a553f84f57812252a185b086470530b01619f Mon Sep 17 00:00:00 2001 From: Baobhan Sith <80159437+Heavrnl@users.noreply.github.com> Date: Fri, 16 May 2025 19:38:15 +0800 Subject: [PATCH] update --- .../src/transfers/transfers.service.ts | 19 ++++++- .../src/components/TransferProgressModal.vue | 56 +++++++++++++++++-- 2 files changed, 69 insertions(+), 6 deletions(-) diff --git a/packages/backend/src/transfers/transfers.service.ts b/packages/backend/src/transfers/transfers.service.ts index 199601a..26a5525 100644 --- a/packages/backend/src/transfers/transfers.service.ts +++ b/packages/backend/src/transfers/transfers.service.ts @@ -679,7 +679,14 @@ export class TransfersService { const task = this.transferTasks.get(taskId); console.debug(`[TransfersService] Retrieving details for task: ${taskId} for user: ${userId}`); if (task && task.userId === userId) { - return { ...task, subTasks: task.subTasks.map(st => ({...st})) }; // Return copies + // Spread the task, then explicitly add top-level fields from payload + const taskToReturn = { + ...task, + subTasks: task.subTasks.map(st => ({ ...st })), + sourceConnectionId: task.payload.sourceConnectionId, + remoteTargetPath: task.payload.remoteTargetPath, + }; + return taskToReturn; } if (task && task.userId !== userId) { console.warn(`[TransfersService] User ${userId} attempted to access task ${taskId} owned by ${task.userId}.`); @@ -692,7 +699,15 @@ export class TransfersService { console.debug(`[TransfersService] Retrieving all transfer tasks for user: ${userId}.`); return Array.from(this.transferTasks.values()) .filter(task => task.userId === userId) - .map(task => ({ ...task, subTasks: task.subTasks.map(st => ({...st})) })); // Return copies + .map(task => { + // Spread the task, then explicitly add top-level fields from payload + return { + ...task, + subTasks: task.subTasks.map(st => ({ ...st })), + sourceConnectionId: task.payload.sourceConnectionId, + remoteTargetPath: task.payload.remoteTargetPath, + }; + }); } public updateSubTaskStatus( diff --git a/packages/frontend/src/components/TransferProgressModal.vue b/packages/frontend/src/components/TransferProgressModal.vue index 4d38dcc..0d7dee7 100644 --- a/packages/frontend/src/components/TransferProgressModal.vue +++ b/packages/frontend/src/components/TransferProgressModal.vue @@ -1,8 +1,9 @@