Add token symbol to accounts datatable.
This commit is contained in:
parent
3b5976c32c
commit
b08250fd12
@ -89,7 +89,9 @@
|
|||||||
|
|
||||||
<ng-container matColumnDef="balance">
|
<ng-container matColumnDef="balance">
|
||||||
<mat-header-cell *matHeaderCellDef mat-sort-header> BALANCE </mat-header-cell>
|
<mat-header-cell *matHeaderCellDef mat-sort-header> BALANCE </mat-header-cell>
|
||||||
<mat-cell *matCellDef="let user"> {{ user?.balance | tokenRatio }} </mat-cell>
|
<mat-cell *matCellDef="let user">
|
||||||
|
{{ user?.balance | tokenRatio }} {{ tokenSymbol | uppercase }}
|
||||||
|
</mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<ng-container matColumnDef="location">
|
<ng-container matColumnDef="location">
|
||||||
|
@ -2,7 +2,7 @@ import { ChangeDetectionStrategy, Component, OnInit, ViewChild } from '@angular/
|
|||||||
import { MatTableDataSource } from '@angular/material/table';
|
import { MatTableDataSource } from '@angular/material/table';
|
||||||
import { MatPaginator } from '@angular/material/paginator';
|
import { MatPaginator } from '@angular/material/paginator';
|
||||||
import { MatSort } from '@angular/material/sort';
|
import { MatSort } from '@angular/material/sort';
|
||||||
import { LoggingService, UserService } from '@app/_services';
|
import { LoggingService, TokenService, UserService } from '@app/_services';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { exportCsv } from '@app/_helpers';
|
import { exportCsv } from '@app/_helpers';
|
||||||
import { strip0x } from '@src/assets/js/ethtx/dist/hex';
|
import { strip0x } from '@src/assets/js/ethtx/dist/hex';
|
||||||
@ -24,6 +24,7 @@ export class AccountsComponent implements OnInit {
|
|||||||
pageSizeOptions: Array<number> = [10, 20, 50, 100];
|
pageSizeOptions: Array<number> = [10, 20, 50, 100];
|
||||||
accountsType: string = 'all';
|
accountsType: string = 'all';
|
||||||
accountTypes: Array<string>;
|
accountTypes: Array<string>;
|
||||||
|
tokenSymbol: string;
|
||||||
|
|
||||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||||
@ViewChild(MatSort) sort: MatSort;
|
@ViewChild(MatSort) sort: MatSort;
|
||||||
@ -31,11 +32,13 @@ export class AccountsComponent implements OnInit {
|
|||||||
constructor(
|
constructor(
|
||||||
private userService: UserService,
|
private userService: UserService,
|
||||||
private loggingService: LoggingService,
|
private loggingService: LoggingService,
|
||||||
private router: Router
|
private router: Router,
|
||||||
|
private tokenService: TokenService
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
async ngOnInit(): Promise<void> {
|
async ngOnInit(): Promise<void> {
|
||||||
await this.userService.init();
|
await this.userService.init();
|
||||||
|
await this.tokenService.init();
|
||||||
try {
|
try {
|
||||||
// TODO it feels like this should be in the onInit handler
|
// TODO it feels like this should be in the onInit handler
|
||||||
await this.userService.loadAccounts(100);
|
await this.userService.loadAccounts(100);
|
||||||
@ -52,6 +55,11 @@ export class AccountsComponent implements OnInit {
|
|||||||
.getAccountTypes()
|
.getAccountTypes()
|
||||||
.pipe(first())
|
.pipe(first())
|
||||||
.subscribe((res) => (this.accountTypes = res));
|
.subscribe((res) => (this.accountTypes = res));
|
||||||
|
this.tokenService.load.subscribe(async (status: boolean) => {
|
||||||
|
if (status) {
|
||||||
|
this.tokenSymbol = await this.tokenService.getTokenSymbol();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
doFilter(value: string): void {
|
doFilter(value: string): void {
|
||||||
|
Loading…
Reference in New Issue
Block a user