Commit 685da94a authored by dev0tion's avatar dev0tion

Temporary catch all statuses

parent 3fa0b4c1
...@@ -22,7 +22,7 @@ export class AppComponent implements OnInit { ...@@ -22,7 +22,7 @@ export class AppComponent implements OnInit {
this.apiService.getWalletStatus() this.apiService.getWalletStatus()
.subscribe( .subscribe(
response => { response => {
if (response.status === 200) { if (response.status >= 200 && response.status < 400) {
this.responseMessage = response; this.responseMessage = response;
this.router.navigate(['/login']); this.router.navigate(['/login']);
} }
......
...@@ -27,14 +27,14 @@ export class LoginComponent implements OnInit { ...@@ -27,14 +27,14 @@ export class LoginComponent implements OnInit {
this.apiService.loadWallet(this.walletLoad) this.apiService.loadWallet(this.walletLoad)
.subscribe( .subscribe(
response => { response => {
if (response.status === 200) { if (response.status >= 200 && response.status < 400) {
this.responseMessage = response; this.responseMessage = response;
this.router.navigate['/wallet'] this.router.navigate['/wallet']
} }
}, },
error => { error => {
this.errorMessage = <any>error; this.errorMessage = <any>error;
if (error.status > 400) { if (error.status >= 400) {
alert(this.errorMessage); alert(this.errorMessage);
console.log(this.errorMessage); console.log(this.errorMessage);
} }
......
...@@ -30,12 +30,12 @@ export class CreateComponent { ...@@ -30,12 +30,12 @@ export class CreateComponent {
.createWallet(this.newWallet) .createWallet(this.newWallet)
.subscribe( .subscribe(
response => { response => {
if (response.status === 200){ if (response.status >= 200 && response.status < 400){
this.responseMessage = response; this.responseMessage = response;
} }
}, },
error => { error => {
if (error.status > 400){ if (error.status >= 400) {
this.errorMessage = error; this.errorMessage = error;
console.log(this.errorMessage); console.log(this.errorMessage);
} }
......
...@@ -31,12 +31,12 @@ export class RecoverComponent implements OnInit { ...@@ -31,12 +31,12 @@ export class RecoverComponent implements OnInit {
.recoverWallet(this.walletRecovery) .recoverWallet(this.walletRecovery)
.subscribe( .subscribe(
response => { response => {
if (response.status === 200) { if (response.status >= 200 && response.status < 400) {
this.responseMessage = response; this.responseMessage = response;
} }
}, },
error => { error => {
if(error.status > 400) { if (error.status >= 400) {
this.errorMessage = error; this.errorMessage = error;
console.log(this.errorMessage); console.log(this.errorMessage);
} }
......
...@@ -22,12 +22,12 @@ export class HistoryComponent { ...@@ -22,12 +22,12 @@ export class HistoryComponent {
this.apiService.getWalletHistory() this.apiService.getWalletHistory()
.subscribe( .subscribe(
response => { response => {
if (response.status === 200) { if (response.status >= 200 && response.status < 400) {
this.transactions = response.history; this.transactions = response.history;
} }
}, },
error => { error => {
if (error.status === 400) { if (error.status >= 400) {
this.errorMessage = <any>error; this.errorMessage = <any>error;
console.log(this.errorMessage); console.log(this.errorMessage);
} }
......
...@@ -22,14 +22,14 @@ export class DashboardComponent { ...@@ -22,14 +22,14 @@ export class DashboardComponent {
this.apiService.getWalletBalance() this.apiService.getWalletBalance()
.subscribe( .subscribe(
response => { response => {
if (response.status === 200) { if (response.status >= 200 && response.status < 400) {
this.balanceResponse = response this.balanceResponse = response
this.confirmedBalance = this.balanceResponse.confirmed; this.confirmedBalance = this.balanceResponse.confirmed;
this.unconfirmedBalance = this.balanceResponse.unconfirmed; this.unconfirmedBalance = this.balanceResponse.unconfirmed;
} }
}, },
error => { error => {
if (error.status > 400) { if (error.status >= 400) {
this.errorMessage = <any>error; this.errorMessage = <any>error;
console.log(this.errorMessage); console.log(this.errorMessage);
} }
......
...@@ -22,12 +22,12 @@ export class ReceiveComponent { ...@@ -22,12 +22,12 @@ export class ReceiveComponent {
this.apiService.getUnusedReceiveAddresses() this.apiService.getUnusedReceiveAddresses()
.subscribe( .subscribe(
response => { response => {
if (response.status === 200) { if (response.status >= 200 && response.status < 400) {
this.addresses = response.addresses; this.addresses = response.addresses;
} }
}, },
error => { error => {
if (error.status > 400) { if (error.status >= 400) {
this.errorMessage = <any>error; this.errorMessage = <any>error;
console.log(this.errorMessage); console.log(this.errorMessage);
} }
......
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