Commit af74d078 authored by dev0tion's avatar dev0tion

Blank pop up workaround

parent e042fbe8
......@@ -28,13 +28,11 @@ export class DashboardComponent implements OnInit {
private walletHistorySubscription: Subscription;
ngOnInit() {
this.getWalletBalance();
this.getHistory();
this.startSubscriptions();
};
ngOnDestroy() {
this.walletBalanceSubscription.unsubscribe();
this.walletHistorySubscription.unsubscribe();
this.cancelSubscriptions();
};
private openSendDialog() {
......@@ -70,7 +68,12 @@ export class DashboardComponent implements OnInit {
console.log(error);
}
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 {
console.log(error);
}
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 {
private walletHistorySubscription: Subscription;
ngOnInit() {
this.getHistory();
this.startSubscriptions();
}
ngOnDestroy() {
this.walletHistorySubscription.unsubscribe();
this.cancelSubscriptions();
}
private openTransactionDetailDialog(transaction: any) {
......@@ -57,11 +57,26 @@ export class HistoryComponent {
console.log(error);
}
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