File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
examples/wallet/app/components Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ export default ({ setAccountFromMnemonic }: Props) => {
23
23
if ( mustCreateSpendingPassword ) {
24
24
if (
25
25
isValidMnemonic ( newMnemonicPhrase ) &&
26
- checkValidPassword ( password , confirmPassword )
26
+ checkValidSpendingPassword ( password , confirmPassword )
27
27
) {
28
28
return Promise . all ( [
29
29
setAccountFromMnemonic (
@@ -60,7 +60,10 @@ export default ({ setAccountFromMnemonic }: Props) => {
60
60
61
61
const [ newMnemonicPassword , setNewMnemonicPassword ] = useState ( '' ) ;
62
62
63
- const checkValidPassword = function checkValidPassword ( pass , confirmation ) {
63
+ const checkValidSpendingPassword = function checkValidSpendingPassword (
64
+ pass ,
65
+ confirmation
66
+ ) {
64
67
if ( ! pass && ! confirmation ) return true ;
65
68
if ( pass . length < 8 ) {
66
69
setIsValidPassword ( false ) ;
@@ -126,6 +129,7 @@ export default ({ setAccountFromMnemonic }: Props) => {
126
129
label = "Create a password to store your settings securely in an encrypted
127
130
storage"
128
131
onChange = { event => handleCheckCreateSpendingPassword ( event ) }
132
+ checked = { mustCreateSpendingPassword }
129
133
/>
130
134
</ Form . Group >
131
135
< Form . Group hidden = { hiddenSpendingPassword } >
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ export default ({ setAccount }: Props) => {
18
18
) {
19
19
event . preventDefault ( ) ;
20
20
if ( mustCreateSpendingPassword ) {
21
- if ( checkValidPassword ( password , confirmPassword ) ) {
21
+ if ( checkValidSpendingPassword ( password , confirmPassword ) ) {
22
22
setAccount ( newPrivateKey , password ) ;
23
23
}
24
24
} else {
@@ -33,7 +33,10 @@ export default ({ setAccount }: Props) => {
33
33
setHiddenSpendingPassword ( ! evt . target . checked ) ;
34
34
} ;
35
35
36
- const checkValidPassword = function checkValidPassword ( pass , confirmation ) {
36
+ const checkValidSpendingPassword = function checkValidSpendingPassword (
37
+ pass ,
38
+ confirmation
39
+ ) {
37
40
if ( ! pass && ! confirmation ) return true ;
38
41
if ( pass . length < 8 ) {
39
42
setIsValidPassword ( false ) ;
@@ -92,6 +95,7 @@ export default ({ setAccount }: Props) => {
92
95
type = "switch"
93
96
label = "Create a password to store your settings securely in an encrypted
94
97
storage"
98
+ checked = { mustCreateSpendingPassword }
95
99
onChange = { event => handleCheckCreateSpendingPassword ( event ) }
96
100
/>
97
101
</ Form . Group >
You can’t perform that action at this time.
0 commit comments