From c72af420b499e0af805ec7da409542d75dd08085 Mon Sep 17 00:00:00 2001 From: Unknown Date: Wed, 24 Jan 2018 16:41:19 +0200 Subject: [PATCH 1/3] final fix for password issue fixed preceeding issue on creation of wallet, due to passwords --- .../createwallet/createwallet.component.ts | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/app/modals/createwallet/createwallet.component.ts b/src/app/modals/createwallet/createwallet.component.ts index 558965bfa..118accdd8 100644 --- a/src/app/modals/createwallet/createwallet.component.ts +++ b/src/app/modals/createwallet/createwallet.component.ts @@ -48,6 +48,7 @@ export class CreateWalletComponent implements OnDestroy { // Used for verification private wordsVerification: string[]; private validating: boolean = false; + private passcount = 0; errorString: string = ''; private destroyed: boolean = false; @@ -104,6 +105,8 @@ export class CreateWalletComponent implements OnDestroy { /* Recovery password entered */ if (this.step === 2) { + this.password = ''; + this.passwordVerify = ''; this.passwordElement.sendPassword(); this.passwordElementVerify.sendPassword(); return; @@ -133,8 +136,8 @@ export class CreateWalletComponent implements OnDestroy { if (this.isRestore) { this.step = 4; } - this.password = undefined; - this.passwordVerify = undefined; + this.password = ''; + this.passwordVerify = ''; break; case 3: this._passphraseService.generateMnemonic( @@ -238,11 +241,12 @@ export class CreateWalletComponent implements OnDestroy { /** Triggered when the password is emitted from PasswordComponent */ passwordFromEmitter(pass: IPassword, verify?: boolean) { + this.passcount++; this[verify ? 'passwordVerify' : 'password'] = pass.password; this.log.d(`passwordFromEmitter: ${this.password} ${verify}`); - if (!!this[verify ? 'password' : 'passwordVerify'] - || this.password === '' && this.passwordVerify === '' - || this.password === undefined && this.passwordVerify === undefined) { + + // Make sure we got both passwords back... + if (this.passcount % 2 === 0) { this.verifyPasswords(); } } @@ -266,7 +270,8 @@ export class CreateWalletComponent implements OnDestroy { this.step++; this.doStep(); } - this.passwordVerify = undefined; + this.passwordVerify = '' + this.password = ''; } /** Triggered when the password is emitted from PassphraseComponent */ From b0204e9c6b299f5658bc69783dad7d6c497077c7 Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 25 Jan 2018 10:19:22 +0200 Subject: [PATCH 2/3] fix issue --- src/app/modals/createwallet/createwallet.component.ts | 9 ++++++++- src/app/modals/shared/password/password.component.ts | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/app/modals/createwallet/createwallet.component.ts b/src/app/modals/createwallet/createwallet.component.ts index 118accdd8..1c7e18609 100644 --- a/src/app/modals/createwallet/createwallet.component.ts +++ b/src/app/modals/createwallet/createwallet.component.ts @@ -48,7 +48,7 @@ export class CreateWalletComponent implements OnDestroy { // Used for verification private wordsVerification: string[]; private validating: boolean = false; - private passcount = 0; + private passcount: number = 0; errorString: string = ''; private destroyed: boolean = false; @@ -248,6 +248,13 @@ export class CreateWalletComponent implements OnDestroy { // Make sure we got both passwords back... if (this.passcount % 2 === 0) { this.verifyPasswords(); + if (this.password === undefined) { + this.password = ''; + if (this.passwordVerify === undefined) { + this.passwordVerify = ''; + } + this.verifyPasswords(); + } } } diff --git a/src/app/modals/shared/password/password.component.ts b/src/app/modals/shared/password/password.component.ts index eac74a814..a4cbf1ad3 100644 --- a/src/app/modals/shared/password/password.component.ts +++ b/src/app/modals/shared/password/password.component.ts @@ -15,7 +15,7 @@ export class PasswordComponent implements OnDestroy { // UI State - password: string; + password: string = ''; private destroyed: boolean = false; @Input() showPass: boolean = false; @@ -77,7 +77,7 @@ export class PasswordComponent implements OnDestroy { } clear(): void { - this.password = undefined; + this.password = ''; } /** From 4a57e111b993267f33ae520d54ebed95b796f986 Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 25 Jan 2018 11:47:20 +0200 Subject: [PATCH 3/3] update fix to be more streamline --- src/app/modals/createwallet/createwallet.component.ts | 9 +-------- src/app/modals/shared/password/password.component.ts | 4 ++-- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/app/modals/createwallet/createwallet.component.ts b/src/app/modals/createwallet/createwallet.component.ts index 1c7e18609..e8ddc6d42 100644 --- a/src/app/modals/createwallet/createwallet.component.ts +++ b/src/app/modals/createwallet/createwallet.component.ts @@ -242,19 +242,12 @@ export class CreateWalletComponent implements OnDestroy { /** Triggered when the password is emitted from PasswordComponent */ passwordFromEmitter(pass: IPassword, verify?: boolean) { this.passcount++; - this[verify ? 'passwordVerify' : 'password'] = pass.password; + this[verify ? 'passwordVerify' : 'password'] = (pass.password || ''); this.log.d(`passwordFromEmitter: ${this.password} ${verify}`); // Make sure we got both passwords back... if (this.passcount % 2 === 0) { this.verifyPasswords(); - if (this.password === undefined) { - this.password = ''; - if (this.passwordVerify === undefined) { - this.passwordVerify = ''; - } - this.verifyPasswords(); - } } } diff --git a/src/app/modals/shared/password/password.component.ts b/src/app/modals/shared/password/password.component.ts index a4cbf1ad3..eac74a814 100644 --- a/src/app/modals/shared/password/password.component.ts +++ b/src/app/modals/shared/password/password.component.ts @@ -15,7 +15,7 @@ export class PasswordComponent implements OnDestroy { // UI State - password: string = ''; + password: string; private destroyed: boolean = false; @Input() showPass: boolean = false; @@ -77,7 +77,7 @@ export class PasswordComponent implements OnDestroy { } clear(): void { - this.password = ''; + this.password = undefined; } /**