Skip to content

Commit

Permalink
Move changedetector from inside constructor (#358)
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher-walsh22 authored Aug 6, 2024
1 parent a3cb4e4 commit bec824f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/app/export-reports/export-reports.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ export class ExportReportsComponent implements OnDestroy {
private cd: ChangeDetectorRef
) {
this.subscriptions.add(
this.dataService.watchItem(Constants.dataIds.EXPORT_VARIANCE_POLLING_DATA).subscribe(res => {
this.dataService.watchItem(Constants.dataIds.EXPORT_VARIANCE_POLLING_DATA)
.subscribe((res) => {
this.jobUpdate(res);
})
)
Expand All @@ -79,12 +80,11 @@ export class ExportReportsComponent implements OnDestroy {
})
)
this.subscriptions.add(
this.dataService
.watchItem(Constants.dataIds.EXPORT_ALL_POLLING_DATA)
this.dataService.watchItem(Constants.dataIds.EXPORT_ALL_POLLING_DATA)
.subscribe((res) => {
this.jobUpdate(res);
}
));
));
}

// setMaxDate() {
Expand Down Expand Up @@ -154,6 +154,7 @@ export class ExportReportsComponent implements OnDestroy {
Constants.dataIds.EXPORT_ALL_POLLING_DATA, 'standard'
);
}
this.cd.detectChanges();
}

setState(state) {
Expand Down Expand Up @@ -230,6 +231,7 @@ export class ExportReportsComponent implements OnDestroy {
} else {
this.exportService.checkForReports(Constants.dataIds.EXPORT_ALL_POLLING_DATA, 'standard');
}
this.cd.detectChanges();
return;
}

Expand Down Expand Up @@ -260,7 +262,6 @@ export class ExportReportsComponent implements OnDestroy {
this.exportMessage = 'No previous report found. Click generate report.';
}
}
this.cd.detectChanges();
}

disableGenerateButton() {
Expand Down

0 comments on commit bec824f

Please sign in to comment.