diff --git a/src/app/modules/core/interceptors/mock.interceptor.ts b/src/app/modules/core/interceptors/mock.interceptor.ts index a2eb26c0..4743ee82 100644 --- a/src/app/modules/core/interceptors/mock.interceptor.ts +++ b/src/app/modules/core/interceptors/mock.interceptor.ts @@ -5,6 +5,7 @@ import { HttpEvent, HttpInterceptor, HttpResponse, + HttpErrorResponse, } from '@angular/common/http'; import { Observable, of } from 'rxjs'; diff --git a/src/app/modules/core/services/validator.service.ts b/src/app/modules/core/services/validator.service.ts index fd668905..b7a32be9 100644 --- a/src/app/modules/core/services/validator.service.ts +++ b/src/app/modules/core/services/validator.service.ts @@ -1,7 +1,7 @@ -import { HttpClient } from '@angular/common/http'; +import { HttpClient, HttpErrorResponse } from '@angular/common/http'; import { Injectable } from '@angular/core'; -import { Observable, Subject, zip } from 'rxjs'; -import { map, share, switchMap } from 'rxjs/operators'; +import { Observable, Subject, zip,of } from 'rxjs'; +import { map, share, switchMap,catchError } from 'rxjs/operators'; import { ValidatorBalances, Validators, ValidatorSummaryResponse } from 'src/app/proto/eth/v1alpha1/beacon_chain'; @@ -63,7 +63,17 @@ export class ValidatorService { } getFeeRecipient(publicKey:string): Observable< ListFeeRecipientResponse>{ - return this.http.get(`${this.keymanagerUrl}/validator/${base64ToHex(publicKey)}/feerecipient`) + return this.http.get(`${this.keymanagerUrl}/validator/${base64ToHex(publicKey)}/feerecipient`).pipe( + catchError((err: HttpErrorResponse) => { + let UNSET_RECIPIENT = "set by beacon node"; + // just let the user know it's set by the beacon node if it's not set + return of({ + data: { + pubkey: base64ToHex(publicKey), + ethaddress: UNSET_RECIPIENT, + } + }); + })); } setFeeRecipient(publicKey:string,request: SetFeeRecipientRequest){ diff --git a/src/app/modules/wallet/components/accounts-table/accounts-table.component.html b/src/app/modules/wallet/components/accounts-table/accounts-table.component.html index c91f6240..10de6243 100644 --- a/src/app/modules/wallet/components/accounts-table/accounts-table.component.html +++ b/src/app/modules/wallet/components/accounts-table/accounts-table.component.html @@ -43,7 +43,8 @@ matTooltipPosition="left" matTooltip="Copy to Clipboard" (click)="copyFeeRecipientToClipboard(row.feeRecipient)" - class="cursor-pointer"> {{row.feeRecipient | slice:0:8 }}... + class="cursor-pointer"> {{ + row.feeRecipient === UNSET_RECIPIENT ? UNSET_RECIPIENT : (row.feeRecipient | slice:0:8)+"..." }} ETH Balance diff --git a/src/app/modules/wallet/components/accounts-table/accounts-table.component.ts b/src/app/modules/wallet/components/accounts-table/accounts-table.component.ts index fc59f43c..4bd545c4 100644 --- a/src/app/modules/wallet/components/accounts-table/accounts-table.component.ts +++ b/src/app/modules/wallet/components/accounts-table/accounts-table.component.ts @@ -37,6 +37,7 @@ export class AccountsTableComponent implements AfterViewInit,OnChanges { @ViewChild(MatSort, { static: false }) sort: MatSort | null = null; readonly LANDING_URL = '/' + LANDING_URL; + readonly UNSET_RECIPIENT = "set by beacon node"; constructor( private dialog: MatDialog,