From 9492da9e0db366c73cd0aa05755a2fb9a1dbf11d Mon Sep 17 00:00:00 2001 From: RehanY147 Date: Thu, 3 Aug 2023 02:55:56 +0500 Subject: [PATCH] NAS-122920: Don't refresh table until the job has concluded (#8507) --- .../data-protection-dashboard.component.ts | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/app/pages/data-protection/data-protection-dashboard.component.ts b/src/app/pages/data-protection/data-protection-dashboard.component.ts index 7c113943d59..916e2fee8db 100644 --- a/src/app/pages/data-protection/data-protection-dashboard.component.ts +++ b/src/app/pages/data-protection/data-protection-dashboard.component.ts @@ -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(); }, }, {