Commit 8163aaca authored by Pieterjan Vanhoof's avatar Pieterjan Vanhoof Committed by GitHub

Merge pull request #224 from stratisproject/ui

Remove package-lock and add blank pop up workaround
parents a8af8ff5 af74d078
...@@ -248,6 +248,7 @@ ModelManifest.xml ...@@ -248,6 +248,7 @@ ModelManifest.xml
# dependencies # dependencies
**/node_modules **/node_modules
package-lock.json
# IDEs and editors # IDEs and editors
/.idea /.idea
......
This diff is collapsed.
...@@ -28,13 +28,11 @@ export class DashboardComponent implements OnInit { ...@@ -28,13 +28,11 @@ export class DashboardComponent implements OnInit {
private walletHistorySubscription: Subscription; private walletHistorySubscription: Subscription;
ngOnInit() { ngOnInit() {
this.getWalletBalance(); this.startSubscriptions();
this.getHistory();
}; };
ngOnDestroy() { ngOnDestroy() {
this.walletBalanceSubscription.unsubscribe(); this.cancelSubscriptions();
this.walletHistorySubscription.unsubscribe();
}; };
private openSendDialog() { private openSendDialog() {
...@@ -70,7 +68,12 @@ export class DashboardComponent implements OnInit { ...@@ -70,7 +68,12 @@ export class DashboardComponent implements OnInit {
console.log(error); console.log(error);
} }
else { else {
alert(error.json().errors[0].description); if (error.json().errors[0].description) {
alert(error.json().errors[0].description);
} else {
this.cancelSubscriptions();
this.startSubscriptions();
}
} }
} }
} }
...@@ -98,11 +101,31 @@ export class DashboardComponent implements OnInit { ...@@ -98,11 +101,31 @@ export class DashboardComponent implements OnInit {
console.log(error); console.log(error);
} }
else { else {
alert(error.json().errors[0].description); if (error.json().errors[0].description) {
alert(error.json().errors[0].description);
} else {
this.cancelSubscriptions();
this.startSubscriptions();
}
} }
} }
} }
) )
; ;
}; };
private cancelSubscriptions() {
if (this.walletBalanceSubscription) {
this.walletBalanceSubscription.unsubscribe();
}
if(this.walletHistorySubscription) {
this.walletHistorySubscription.unsubscribe();
}
};
private startSubscriptions() {
this.getWalletBalance();
this.getHistory();
}
} }
...@@ -25,11 +25,11 @@ export class HistoryComponent { ...@@ -25,11 +25,11 @@ export class HistoryComponent {
private walletHistorySubscription: Subscription; private walletHistorySubscription: Subscription;
ngOnInit() { ngOnInit() {
this.getHistory(); this.startSubscriptions();
} }
ngOnDestroy() { ngOnDestroy() {
this.walletHistorySubscription.unsubscribe(); this.cancelSubscriptions();
} }
private openTransactionDetailDialog(transaction: any) { private openTransactionDetailDialog(transaction: any) {
...@@ -57,11 +57,26 @@ export class HistoryComponent { ...@@ -57,11 +57,26 @@ export class HistoryComponent {
console.log(error); console.log(error);
} }
else { else {
alert(error.json().errors[0].description); if (error.json().errors[0].description) {
alert(error.json().errors[0].description);
} else {
this.cancelSubscriptions();
this.startSubscriptions();
}
} }
} }
} }
) )
; ;
};
private cancelSubscriptions() {
if(this.walletHistorySubscription) {
this.walletHistorySubscription.unsubscribe();
}
};
private startSubscriptions() {
this.getHistory();
} }
} }
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