Merge remote-tracking branch 'origin/bvander/accounts-search-review' into bvander/accounts-search-review

# Conflicts:
#	src/app/_services/user.service.ts
#	src/app/pages/accounts/accounts.component.ts
This commit is contained in:
Spencer Ofwiti 2021-05-09 20:08:39 +03:00
commit c83cc5240e
3 changed files with 13 additions and 4 deletions

View File

@ -15,6 +15,7 @@ export class RegistryService {
constructor() { constructor() {
this.registry.declaratorHelper.addTrust(environment.trustedDeclaratorAddress); this.registry.declaratorHelper.addTrust(environment.trustedDeclaratorAddress);
this.registry.load();
} }
async load(): Promise<any> { async load(): Promise<any> {

View File

@ -40,15 +40,21 @@ export class UserService {
private registryService: RegistryService, private registryService: RegistryService,
private authService: AuthService private authService: AuthService
) { ) {
//this.authService.init().then(() => {
// this.keystore = authService.mutableKeyStore;
// this.signer = new PGPSigner(this.keystore);
//});
//this.registry = registryService.getRegistry();
//this.registry.load();
} }
await load(): Observable<any> { async load(): Promise<any> {
try { try {
// TODO this method is called by ngOnInit so we need to // TODO this method is called by ngOnInit so we need to
// emit an observalbe or conver ngonInit to promise // emit an observalbe or conver ngonInit to promise
// TODO alig the load/init methods naming // TODO alig the load/init methods naming
await this.authService.init(); await this.authService.init();
await this.registryService.load(); // await this.registryService.load();
// TODO key store is defined // TODO key store is defined
this.keystore = this.authService.mutableKeyStore; this.keystore = this.authService.mutableKeyStore;
this.signer = new PGPSigner(this.keystore); this.signer = new PGPSigner(this.keystore);

View File

@ -9,6 +9,8 @@ import {strip0x} from '@src/assets/js/ethtx/dist/hex';
import {first} from 'rxjs/operators'; import {first} from 'rxjs/operators';
import {environment} from '@src/environments/environment'; import {environment} from '@src/environments/environment';
import {AccountDetails} from '@app/_models'; import {AccountDetails} from '@app/_models';
import {Observable, of} from 'rxjs';
@Component({ @Component({
selector: 'app-accounts', selector: 'app-accounts',
@ -34,11 +36,11 @@ export class AccountsComponent implements OnInit {
private loggingService: LoggingService private loggingService: LoggingService
) )
{ {
this.userService = userService;
} }
ngOnInit(): void { ngOnInit(): void {
// TODO end of the line you gotta be an observalbe or a promise of(this.userService.load())
this.userService.load();
this.userService.getAccountTypes().pipe(first()).subscribe(res => this.accountTypes = res); this.userService.getAccountTypes().pipe(first()).subscribe(res => this.accountTypes = res);
this.userService.accountsSubject.subscribe(accounts => { this.userService.accountsSubject.subscribe(accounts => {
this.dataSource = new MatTableDataSource<any>(accounts); this.dataSource = new MatTableDataSource<any>(accounts);