diff --git a/src/app/health-page/health-page.component.html b/src/app/health-page/health-page.component.html
index 0647620c73..605927dc55 100644
--- a/src/app/health-page/health-page.component.html
+++ b/src/app/health-page/health-page.component.html
@@ -1,4 +1,4 @@
-
+
-
diff --git a/src/app/health-page/health-page.component.ts b/src/app/health-page/health-page.component.ts
index a92e72744b..aa7bd7cba4 100644
--- a/src/app/health-page/health-page.component.ts
+++ b/src/app/health-page/health-page.component.ts
@@ -23,6 +23,16 @@ export class HealthPageComponent implements OnInit {
*/
healthResponse: BehaviorSubject = new BehaviorSubject(null);
+ /**
+ * Represent if the response from health status endpoint is already retrieved or not
+ */
+ healthResponseInitialised: BehaviorSubject = new BehaviorSubject(false);
+
+ /**
+ * Represent if the response from health info endpoint is already retrieved or not
+ */
+ healthInfoResponseInitialised: BehaviorSubject = new BehaviorSubject(false);
+
constructor(private healthDataService: HealthService) {
}
@@ -31,13 +41,25 @@ export class HealthPageComponent implements OnInit {
*/
ngOnInit(): void {
this.healthDataService.getHealth().pipe(take(1)).subscribe({
- next: (data: any) => { this.healthResponse.next(data.payload); },
- error: () => { this.healthResponse.next(null); }
+ next: (data: any) => {
+ this.healthResponse.next(data.payload);
+ this.healthResponseInitialised.next(true);
+ },
+ error: () => {
+ this.healthResponse.next(null);
+ this.healthResponseInitialised.next(true);
+ }
});
this.healthDataService.getInfo().pipe(take(1)).subscribe({
- next: (data: any) => { this.healthInfoResponse.next(data.payload); },
- error: () => { this.healthInfoResponse.next(null); }
+ next: (data: any) => {
+ this.healthInfoResponse.next(data.payload);
+ this.healthInfoResponseInitialised.next(true);
+ },
+ error: () => {
+ this.healthInfoResponse.next(null);
+ this.healthInfoResponseInitialised.next(true);
+ }
});
}