Commit 1f552fe5 authored by dev0tion's avatar dev0tion

Only load Stratis when Bitcoin is successfully loaded

parent 380b60c0
...@@ -125,7 +125,10 @@ export class LoginComponent implements OnInit { ...@@ -125,7 +125,10 @@ export class LoginComponent implements OnInit {
.subscribe( .subscribe(
response => { response => {
if (response.status >= 200 && response.status < 400) { if (response.status >= 200 && response.status < 400) {
//Bitcoin wallet loaded // Set Bitcoin as the default wallet
this.globalService.setCoinName("Bitcoin");
this.globalService.setWalletName(walletLoad.name);
this.globalService.setCoinType(1);
} }
}, },
error => { error => {
...@@ -139,17 +142,18 @@ export class LoginComponent implements OnInit { ...@@ -139,17 +142,18 @@ export class LoginComponent implements OnInit {
alert(error.json().errors[0].message); alert(error.json().errors[0].message);
} }
} }
} },
() => this.loadStratisWallet(walletLoad)
) )
; ;
}
private loadStratisWallet(walletLoad: WalletLoad) {
this.apiService.loadStratisWallet(walletLoad) this.apiService.loadStratisWallet(walletLoad)
.subscribe( .subscribe(
response => { response => {
if (response.status >= 200 && response.status < 400) { if (response.status >= 200 && response.status < 400) {
this.globalService.setCoinName("Bitcoin"); // Navigate to the wallet section
this.globalService.setWalletName(walletLoad.name);
this.globalService.setCoinType(1);
this.router.navigate(['/wallet']); this.router.navigate(['/wallet']);
} }
}, },
......
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