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:
commit
c83cc5240e
@ -15,6 +15,7 @@ export class RegistryService {
|
||||
|
||||
constructor() {
|
||||
this.registry.declaratorHelper.addTrust(environment.trustedDeclaratorAddress);
|
||||
this.registry.load();
|
||||
}
|
||||
|
||||
async load(): Promise<any> {
|
||||
|
@ -40,15 +40,21 @@ export class UserService {
|
||||
private registryService: RegistryService,
|
||||
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 {
|
||||
// TODO this method is called by ngOnInit so we need to
|
||||
// emit an observalbe or conver ngonInit to promise
|
||||
// TODO alig the load/init methods naming
|
||||
await this.authService.init();
|
||||
await this.registryService.load();
|
||||
// await this.registryService.load();
|
||||
// TODO key store is defined
|
||||
this.keystore = this.authService.mutableKeyStore;
|
||||
this.signer = new PGPSigner(this.keystore);
|
||||
|
@ -9,6 +9,8 @@ import {strip0x} from '@src/assets/js/ethtx/dist/hex';
|
||||
import {first} from 'rxjs/operators';
|
||||
import {environment} from '@src/environments/environment';
|
||||
import {AccountDetails} from '@app/_models';
|
||||
import {Observable, of} from 'rxjs';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-accounts',
|
||||
@ -34,11 +36,11 @@ export class AccountsComponent implements OnInit {
|
||||
private loggingService: LoggingService
|
||||
)
|
||||
{
|
||||
this.userService = userService;
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
// TODO end of the line you gotta be an observalbe or a promise
|
||||
this.userService.load();
|
||||
of(this.userService.load())
|
||||
this.userService.getAccountTypes().pipe(first()).subscribe(res => this.accountTypes = res);
|
||||
this.userService.accountsSubject.subscribe(accounts => {
|
||||
this.dataSource = new MatTableDataSource<any>(accounts);
|
||||
|
Loading…
Reference in New Issue
Block a user