Commit 0fce8e77 authored by dev0tion's avatar dev0tion

Wait for both Bitcoin and Stratis daemons to be loaded

parent 77328991
......@@ -23,7 +23,11 @@ export class AppComponent implements OnInit {
ngOnInit() {
this.setTitle();
this.apiService.getWalletFiles().retryWhen(errors => errors.delay(2000)).subscribe(() => this.startApp());
this.apiService.getWalletFiles().retryWhen(errors => errors.delay(2000)).subscribe(() => this.checkStratisDaemon());
}
private checkStratisDaemon() {
this.apiService.getStratisWalletFiles().retryWhen(errors => errors.delay(2000)).subscribe(() => this.startApp());
}
private startApp() {
......
......@@ -48,6 +48,16 @@ export class ApiService {
.map((response: Response) => response);
}
/**
* Gets available wallets at the default path
*/
getStratisWalletFiles(): Observable<any> {
return this.http
.get(this.stratisApiUrl + '/wallet/files')
.map((response: Response) => response);
}
/**
* Get a new mnemonic
*/
......
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