Commit d77f79e7 authored by dev0tion's avatar dev0tion

Wait on API to load UI

parent fb5ed9b1
<router-outlet></router-outlet>
\ No newline at end of file
<div *ngIf="loading">Loading...</div>
<router-outlet *ngIf="!loading"></router-outlet>
......@@ -3,6 +3,9 @@ import { Router } from '@angular/router';
import { ApiService } from './shared/services/api.service';
import 'rxjs/add/operator/retryWhen';
import 'rxjs/add/operator/delay';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
......@@ -13,8 +16,14 @@ export class AppComponent implements OnInit {
constructor(private router: Router, private apiService: ApiService) {}
private errorMessage: any;
private responseMessage: any;
private loading: boolean = true;
ngOnInit() {
this.apiService.getWalletFiles().retryWhen(errors => errors.delay(2000)).subscribe(() => this.startApp());
}
startApp() {
this.loading = false;
this.router.navigate(['/login']);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment