Skip to content

Commit

Permalink
CB-6000 refactor: AsyncTask creation
Browse files Browse the repository at this point in the history
  • Loading branch information
SychevAndrey committed Dec 13, 2024
1 parent 2a956ac commit f457166
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions webapp/packages/core-root/src/AsyncTask/AsyncTaskInfoService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,16 @@ export class AsyncTaskInfoService extends Disposable {

this.tasks.set(task.id, task);
task.onStatusChange.addHandler(info => {
if (this.taskIdAliases.get(info.id)) {
return;
}

this.taskIdAliases.set(info.id, task.id);

const pendingEvent = this.pendingEvents.get(info.id);
if (pendingEvent) {
const changes = { ...pendingEvent };
this.pendingEvents.delete(info.id);
this.updateTask(task, changes);
}
if (!this.taskIdAliases.get(info.id)) {
this.taskIdAliases.set(info.id, task.id);
this.updateTask(task, pendingEvent);
}
});

Expand Down

0 comments on commit f457166

Please sign in to comment.