diff --git a/archigator/src/app/main/main.component.html b/archigator/src/app/main/main.component.html index a3bc678..8fb9c3c 100644 --- a/archigator/src/app/main/main.component.html +++ b/archigator/src/app/main/main.component.html @@ -1,8 +1,13 @@ -
+
-
+
+ +

Loading...

+
+ +
@@ -35,7 +40,7 @@
-
+
Could not load metadata
diff --git a/archigator/src/app/main/main.component.ts b/archigator/src/app/main/main.component.ts index 8345c0c..947db96 100644 --- a/archigator/src/app/main/main.component.ts +++ b/archigator/src/app/main/main.component.ts @@ -20,6 +20,8 @@ import {Metadata} from "../shared/response"; export class MainComponent implements OnInit{ hasMetadata: boolean = false; + loading: boolean = true; + error: boolean = false; constructor(private oauthService: OAuthService, private parameterService: ParametersService, @@ -67,14 +69,19 @@ export class MainComponent implements OnInit{ loadMetadata() { this.apiService.getMetadata().subscribe( (metadata: Metadata) => { + this.loading = false; if (metadata) { // Handle the logic here if metadata is not null or undefined this.hasMetadata = true; + } else { + this.error = true; } }, (error) => { console.error('Failed to load metadata:', error); - this.hasMetadata = false; + // this.hasMetadata = false; + this.loading = false; + this.error = true; } ); }