Skip to content

Commit 171f20d

Browse files
committed
Unlocking wallet function are renamed
1 parent a001d53 commit 171f20d

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

examples/wallet/app/components/RestoreWalletFromMnemonic.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export default ({ setAccountFromMnemonic }: Props) => {
2323
if (mustCreateSpendingPassword) {
2424
if (
2525
isValidMnemonic(newMnemonicPhrase) &&
26-
checkValidPassword(password, confirmPassword)
26+
checkValidSpendingPassword(password, confirmPassword)
2727
) {
2828
return Promise.all([
2929
setAccountFromMnemonic(
@@ -60,7 +60,10 @@ export default ({ setAccountFromMnemonic }: Props) => {
6060

6161
const [newMnemonicPassword, setNewMnemonicPassword] = useState('');
6262

63-
const checkValidPassword = function checkValidPassword(pass, confirmation) {
63+
const checkValidSpendingPassword = function checkValidSpendingPassword(
64+
pass,
65+
confirmation
66+
) {
6467
if (!pass && !confirmation) return true;
6568
if (pass.length < 8) {
6669
setIsValidPassword(false);
@@ -126,6 +129,7 @@ export default ({ setAccountFromMnemonic }: Props) => {
126129
label="Create a password to store your settings securely in an encrypted
127130
storage"
128131
onChange={event => handleCheckCreateSpendingPassword(event)}
132+
checked={mustCreateSpendingPassword}
129133
/>
130134
</Form.Group>
131135
<Form.Group hidden={hiddenSpendingPassword}>

examples/wallet/app/components/RestoreWalletFromPrivateKey.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default ({ setAccount }: Props) => {
1818
) {
1919
event.preventDefault();
2020
if (mustCreateSpendingPassword) {
21-
if (checkValidPassword(password, confirmPassword)) {
21+
if (checkValidSpendingPassword(password, confirmPassword)) {
2222
setAccount(newPrivateKey, password);
2323
}
2424
} else {
@@ -33,7 +33,10 @@ export default ({ setAccount }: Props) => {
3333
setHiddenSpendingPassword(!evt.target.checked);
3434
};
3535

36-
const checkValidPassword = function checkValidPassword(pass, confirmation) {
36+
const checkValidSpendingPassword = function checkValidSpendingPassword(
37+
pass,
38+
confirmation
39+
) {
3740
if (!pass && !confirmation) return true;
3841
if (pass.length < 8) {
3942
setIsValidPassword(false);
@@ -92,6 +95,7 @@ export default ({ setAccount }: Props) => {
9295
type="switch"
9396
label="Create a password to store your settings securely in an encrypted
9497
storage"
98+
checked={mustCreateSpendingPassword}
9599
onChange={event => handleCheckCreateSpendingPassword(event)}
96100
/>
97101
</Form.Group>

0 commit comments

Comments
 (0)