Refactor transactions table to show address before loading account meta.
This commit is contained in:
parent
9782c919d5
commit
16af939af7
@ -1,5 +1,5 @@
|
||||
import Web3 from 'web3';
|
||||
import {Web3Service} from '@app/_services/web3.service';
|
||||
import { Web3Service } from '@app/_services/web3.service';
|
||||
|
||||
const abi: Array<any> = require('@src/assets/js/block-sync/data/AccountsIndex.json');
|
||||
const web3: Web3 = Web3Service.getInstance();
|
||||
|
@ -1,5 +1,5 @@
|
||||
import Web3 from 'web3';
|
||||
import {Web3Service} from '@app/_services/web3.service';
|
||||
import { Web3Service } from '@app/_services/web3.service';
|
||||
|
||||
const abi: Array<any> = require('@src/assets/js/block-sync/data/TokenUniqueSymbolIndex.json');
|
||||
const web3: Web3 = Web3Service.getInstance();
|
||||
|
@ -6,7 +6,7 @@ import { TransactionService } from '@app/_services/transaction.service';
|
||||
import { environment } from '@src/environments/environment';
|
||||
import { LoggingService } from '@app/_services/logging.service';
|
||||
import { RegistryService } from '@app/_services/registry.service';
|
||||
import {Web3Service} from '@app/_services/web3.service';
|
||||
import { Web3Service } from '@app/_services/web3.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
|
@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
|
||||
import { environment } from '@src/environments/environment';
|
||||
import { CICRegistry, FileGetter } from 'cic-client';
|
||||
import { HttpGetter } from '@app/_helpers';
|
||||
import {Web3Service} from '@app/_services/web3.service';
|
||||
import { Web3Service } from '@app/_services/web3.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
|
@ -17,7 +17,7 @@ import { HttpClient } from '@angular/common/http';
|
||||
import { CICRegistry } from 'cic-client';
|
||||
import { RegistryService } from '@app/_services/registry.service';
|
||||
import Web3 from 'web3';
|
||||
import {Web3Service} from '@app/_services/web3.service';
|
||||
import { Web3Service } from '@app/_services/web3.service';
|
||||
const vCard = require('vcard-parser');
|
||||
|
||||
@Injectable({
|
||||
|
@ -1,14 +1,14 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import Web3 from 'web3';
|
||||
import {environment} from '@src/environments/environment';
|
||||
import { environment } from '@src/environments/environment';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class Web3Service {
|
||||
private static web3: Web3;
|
||||
|
||||
constructor() { }
|
||||
constructor() {}
|
||||
|
||||
public static getInstance(): Web3 {
|
||||
if (!Web3Service.web3) {
|
||||
|
@ -121,8 +121,10 @@ export class AccountDetailsComponent implements OnInit {
|
||||
location: this.account.location.area,
|
||||
locationType: this.account.location.area_type,
|
||||
});
|
||||
this.userService.getAccountStatus(this.account.vcard?.tel[0].value).pipe(first())
|
||||
.subscribe(response => this.accountStatus = response.status);
|
||||
this.userService
|
||||
.getAccountStatus(this.account.vcard?.tel[0].value)
|
||||
.pipe(first())
|
||||
.subscribe((response) => (this.accountStatus = response.status));
|
||||
} else {
|
||||
alert('Account not found!');
|
||||
}
|
||||
|
@ -48,12 +48,12 @@
|
||||
|
||||
<ng-container matColumnDef="sender">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header> Sender </th>
|
||||
<td mat-cell *matCellDef="let transaction"> {{transaction?.sender?.vcard.fn[0].value}} </td>
|
||||
<td mat-cell *matCellDef="let transaction"> {{transaction?.sender?.vcard.fn[0].value || transaction.from}} </td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="recipient">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header> Recipient </th>
|
||||
<td mat-cell *matCellDef="let transaction"> {{transaction?.recipient?.vcard.fn[0].value}} </td>
|
||||
<td mat-cell *matCellDef="let transaction"> {{transaction?.recipient?.vcard.fn[0].value || transaction.to }} </td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="value">
|
||||
|
Loading…
Reference in New Issue
Block a user