From 3d08e1666200a34b5618bf4be7313e4d779d6b87 Mon Sep 17 00:00:00 2001 From: RadoslavDimchev Date: Sun, 15 Oct 2023 22:33:13 +0300 Subject: [PATCH] fix: add clear functions for keystore passwords --- .../KeyGeneration/KeystoreFiles.tsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/pages/ValidatorOnboarding/KeyGeneration/KeystoreFiles.tsx b/src/pages/ValidatorOnboarding/KeyGeneration/KeystoreFiles.tsx index 1fb44a9d..0b81ed5e 100644 --- a/src/pages/ValidatorOnboarding/KeyGeneration/KeystoreFiles.tsx +++ b/src/pages/ValidatorOnboarding/KeyGeneration/KeystoreFiles.tsx @@ -50,6 +50,16 @@ const KeystoreFiles = () => { return '*'.repeat(passwordLength) } + const clearEncryptedPasswordHandler = () => { + setEncryptedPassword('') + setDisplayEncryptedPassword('') + } + + const clearConfirmEncryptedPasswordHandler = () => { + setConfirmEncryptedPassword('') + setDisplayConfirmEncryptedPassword('') + } + return ( @@ -65,7 +75,7 @@ const KeystoreFiles = () => { size={16} color="#A1ABBD" style={{ cursor: 'pointer' }} - onClick={() => setEncryptedPassword('')} + onClick={clearEncryptedPasswordHandler} /> } error={encryptedPasswordError} @@ -84,7 +94,7 @@ const KeystoreFiles = () => { size={16} color="#A1ABBD" style={{ cursor: 'pointer' }} - onClick={() => setConfirmEncryptedPassword('')} + onClick={clearConfirmEncryptedPasswordHandler} /> } error={confirmEncryptedPasswordError}