Skip to content

Commit

Permalink
NAS-122920: Don't refresh table until the job has concluded (#8507)
Browse files Browse the repository at this point in the history
  • Loading branch information
RehanY147 authored Aug 2, 2023
1 parent 9691b70 commit 9492da9
Showing 1 changed file with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -569,19 +569,20 @@ export class DataProtectionDashboardComponent implements OnInit {
this.translate.instant('Replication «{name}» has started.', { name: row.name }),
);
}),
tap((job) => {
if (!([JobState.Running, JobState.Pending].includes(job.state))) {
this.refreshTable(TaskCardId.Replication); return;
}
row.state.state = job.state;
row.job = { ...job };
this.jobStates.set(job.id, job.state);
}),
catchError((error: Job) => {
this.dialogService.error(this.errorHandler.parseJobError(error));
return EMPTY;
}),
untilDestroyed(this),
).subscribe((job: Job) => {
row.state.state = job.state;
row.job = { ...job };
if (this.jobStates.get(job.id) !== job.state) {
this.refreshTable(TaskCardId.Replication);
}
this.jobStates.set(job.id, job.state);
});
).subscribe();
},
},
{
Expand Down

0 comments on commit 9492da9

Please sign in to comment.