Skip to content

Commit

Permalink
[gh-NangoHQ#610] fully consolidate
Browse files Browse the repository at this point in the history
  • Loading branch information
khaliqgant committed May 4, 2023
1 parent a9f70f9 commit 7068e4e
Show file tree
Hide file tree
Showing 4 changed files with 233 additions and 269 deletions.
3 changes: 2 additions & 1 deletion packages/server/lib/controllers/activity.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,13 @@ class ActivityController {
sessions[log.sessionId] = i;
}

if (log?.merge && sessions[log.sessionId as string]) {
if (log?.merge && typeof sessions[log.sessionId as string] !== 'undefined') {
const mergeIndex: number = updatedLogs.findIndex((updated) => {
return updated.sessionId === log.sessionId && !updated.merge;
});
updatedLogs[mergeIndex]!.messages = [...updatedLogs[mergeIndex]!.messages, ...log.messages];
updatedLogs[mergeIndex]!.end = log.end as number;
updatedLogs[mergeIndex]!.success = log.success;
} else {
updatedLogs.push(log as LogData);
}
Expand Down
Loading

0 comments on commit 7068e4e

Please sign in to comment.