From 982bb5eac3bb0b56dccff90b1afb106bb8c62c64 Mon Sep 17 00:00:00 2001 From: Milad Date: Tue, 9 Aug 2022 04:17:36 +0430 Subject: [PATCH] Adding a few lines of code to complete biometrics --- angular/src/app/home/home.component.html | 33 +++++++++++-------- angular/src/app/home/home.component.ts | 4 +++ .../app/wallet/create/create.component.html | 2 +- 3 files changed, 25 insertions(+), 14 deletions(-) diff --git a/angular/src/app/home/home.component.html b/angular/src/app/home/home.component.html index 7cc948b0..3adb0a00 100644 --- a/angular/src/app/home/home.component.html +++ b/angular/src/app/home/home.component.html @@ -1,27 +1,34 @@
- + -

{{uiState.manifest?.name}}

-
{{ 'App.By' | translate }} {{uiState.manifest?.author}}
- +

{{uiState.manifest?.name}}

+
{{ 'App.By' | translate }} {{uiState.manifest?.author}}
+ -

{{ 'App.EnterPassordToUnlock' | translate }}

+

{{ 'App.EnterPassordToUnlock' | translate }}

+ +

+ Use BiometricsUse Face ID +

+ +
- {{ 'App.Password' | translate }} - + {{ 'App.Password' | translate }} +
- + - {{error}} - cancel - - + {{error}} + cancel + +
-
\ No newline at end of file +
+ diff --git a/angular/src/app/home/home.component.ts b/angular/src/app/home/home.component.ts index c09818ff..eaeeeb8e 100644 --- a/angular/src/app/home/home.component.ts +++ b/angular/src/app/home/home.component.ts @@ -18,6 +18,7 @@ export class HomeComponent implements OnInit, OnDestroy { wallet: any; error = ''; sub2: any; + biometrics: boolean; constructor(public uiState: UIState, private translate: TranslateService, private crypto: CryptoService, private router: Router, private communication: CommunicationService, private secure: SecureStateService, public walletManager: WalletManager, private cd: ChangeDetectorRef) { console.log('HOME COMPONENT!'); @@ -38,6 +39,8 @@ export class HomeComponent implements OnInit, OnDestroy { // this.uiState.title = `Unlock ${this.walletManager.activeWallet.name}`; this.uiState.title = await this.translate.get('App.UnlockTitle', { value: this.walletManager.activeWallet.name }).toPromise(); + this.biometrics = this.walletManager.activeWallet.biometrics + if (this.secure.unlocked(this.walletManager.activeWallet?.id)) { console.log('Wallet already unlocked!!'); @@ -66,6 +69,7 @@ export class HomeComponent implements OnInit, OnDestroy { this.error = null; if (this.walletManager.activeWallet) { + const unlocked = await this.walletManager.unlockWallet(this.walletManager.activeWallet.id, this.unlockPassword); // this.manager.unlock(this.uiState.activeWallet.id, this.unlockPassword); diff --git a/angular/src/app/wallet/create/create.component.html b/angular/src/app/wallet/create/create.component.html index 6a219d5f..72ebc630 100644 --- a/angular/src/app/wallet/create/create.component.html +++ b/angular/src/app/wallet/create/create.component.html @@ -118,7 +118,7 @@

Create a password

- +

Use BiometricsUse Face ID