Commit 80cdb66b authored by Pieterjan Vanhoof's avatar Pieterjan Vanhoof Committed by GitHub

Merge pull request #225 from stratisproject/ui

Add blank popup workaround to status bar
parents 8163aaca 7731844c
...@@ -25,11 +25,11 @@ export class StatusBarComponent implements OnInit { ...@@ -25,11 +25,11 @@ export class StatusBarComponent implements OnInit {
constructor(private apiService: ApiService, private globalService: GlobalService) { } constructor(private apiService: ApiService, private globalService: GlobalService) { }
ngOnInit() { ngOnInit() {
this.getGeneralWalletInfo() this.startSubscriptions();
} }
ngOnDestroy() { ngOnDestroy() {
this.generalWalletInfoSubscription.unsubscribe(); this.cancelSubscriptions();
} }
getGeneralWalletInfo() { getGeneralWalletInfo() {
...@@ -66,12 +66,26 @@ export class StatusBarComponent implements OnInit { ...@@ -66,12 +66,26 @@ export class StatusBarComponent implements OnInit {
console.log(error); console.log(error);
} }
else { else {
if (error.json().errors[0].description) {
alert(error.json().errors[0].description); alert(error.json().errors[0].description);
} else {
this.cancelSubscriptions();
this.startSubscriptions();
}
} }
} }
} }
) )
; ;
};
private cancelSubscriptions() {
if(this.generalWalletInfoSubscription) {
this.generalWalletInfoSubscription.unsubscribe();
} }
};
private startSubscriptions() {
this.getGeneralWalletInfo();
}
} }
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