diff --git a/www/libs/feature/deployer/src/lib/dictionary/dictionary.component.html b/www/libs/feature/deployer/src/lib/dictionary/dictionary.component.html index f18e053..ede5559 100644 --- a/www/libs/feature/deployer/src/lib/dictionary/dictionary.component.html +++ b/www/libs/feature/deployer/src/lib/dictionary/dictionary.component.html @@ -72,10 +72,7 @@

Dict

(click)="setAccountHash()" >↓ account-hash - ↓ account-base64 diff --git a/www/libs/feature/deployer/src/lib/public-key/public-key.component.html b/www/libs/feature/deployer/src/lib/public-key/public-key.component.html index cb57d06..d35aadd 100644 --- a/www/libs/feature/deployer/src/lib/public-key/public-key.component.html +++ b/www/libs/feature/deployer/src/lib/public-key/public-key.component.html @@ -40,7 +40,7 @@

Config

#activePublicKeyElt type="search" [value]="activePublicKey || ''" - (change)="(true)" + (change)="setActivePublicKey($event)" (keyup.enter)="getPurseURef()" placeholder="ex: 0x" /> diff --git a/www/libs/feature/deployer/src/lib/public-key/public-key.component.ts b/www/libs/feature/deployer/src/lib/public-key/public-key.component.ts index f0708cc..13142fb 100644 --- a/www/libs/feature/deployer/src/lib/public-key/public-key.component.ts +++ b/www/libs/feature/deployer/src/lib/public-key/public-key.component.ts @@ -1,6 +1,6 @@ import { AfterViewInit, ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, EventEmitter, Inject, OnDestroy, Output, ViewChild } from '@angular/core'; import { CommonModule } from '@angular/common'; -import { State } from '@casper-api/api-interfaces'; +import { State, User } from '@casper-api/api-interfaces'; import { DeployerService } from '@casper-data/data-access-deployer'; import { Subscription } from 'rxjs'; import { ResultService } from '../result/result.service'; @@ -22,6 +22,7 @@ export class PublicKeyComponent implements AfterViewInit, OnDestroy { apiUrl?: string; activePublicKey?: string; + user?: User; private getStateSubscription!: Subscription; private getPurseURefSubscription!: Subscription; @@ -53,10 +54,23 @@ export class PublicKeyComponent implements AfterViewInit, OnDestroy { this.activePublicKeyElt.nativeElement.value = state.user.activePublicKey ); + this.user = state.user; this.changeDetectorRef.markForCheck(); }); } + setActivePublicKey($event: Event) { + const public_key = ($event.target as HTMLSelectElement).value || ''; + if (public_key) { + this.user = { + activePublicKey: public_key + }; + this.deployerService.setState({ + user: this.user + }); + } + } + getPurseURef(): void { if (!this.isFormValid()) { return;