Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
parity
Mirrored projects
parity-signer
Commits
b62b983d
Commit
b62b983d
authored
Jul 24, 2019
by
Thibaut Sardan
Browse files
fix(): init
parent
ec2a44ee
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/components/AccountIconChooser.js
View file @
b62b983d
...
...
@@ -56,11 +56,12 @@ export default class AccountIconChooser extends React.PureComponent<{
.
split
(
'
'
)
.
map
(
async
()
=>
{
const
seed
=
await
words
();
const
{
address
}
=
await
brainWalletAddress
(
seed
);
const
{
address
,
bip39
}
=
await
brainWalletAddress
(
seed
);
return
{
address
,
seed
,
address
bip39
};
})
);
...
...
@@ -75,6 +76,7 @@ export default class AccountIconChooser extends React.PureComponent<{
renderIcon
=
({
item
,
index
})
=>
{
const
{
value
,
onChange
}
=
this
.
props
;
const
{
address
,
seed
,
bip39
}
=
item
;
const
iSelected
=
item
.
address
.
toLowerCase
()
===
value
.
toLowerCase
();
const
style
=
[
styles
.
icon
];
...
...
@@ -84,8 +86,9 @@ export default class AccountIconChooser extends React.PureComponent<{
style
=
{[
styles
.
iconBorder
,
iSelected
?
styles
.
selected
:
{}]}
onPress
=
{()
=>
onChange
({
address
:
item
.
address
,
seed
:
item
.
seed
address
,
seed
,
bip39
})
}
>
...
...
src/screens/AccountNew.js
View file @
b62b983d
...
...
@@ -73,8 +73,8 @@ class AccountNewView extends React.Component {
<
/Text
>
<
AccountIconChooser
value
=
{
selected
&&
selected
.
seed
&&
selected
.
address
}
onChange
=
{({
address
,
seed
})
=>
{
accounts
.
updateNew
({
address
,
seed
}
);
onChange
=
{({
address
,
seed
,
bip39
})
=>
{
accounts
.
updateNew
({
address
,
seed
,
validBip39Seed
:
bip39
},
false
);
}}
/
>
<
Text
style
=
{
styles
.
title
}
>
ACCOUNT
NAME
<
/Text
>
...
...
src/stores/AccountsStore.js
View file @
b62b983d
...
...
@@ -65,18 +65,35 @@ export default class AccountsStore extends Container<AccountsState> {
});
}
updateNew
(
accountUpdate
:
Object
)
{
Object
.
assign
(
this
.
state
.
newAccount
,
accountUpdate
);
const
{
seed
}
=
this
.
state
.
newAccount
;
if
(
typeof
seed
===
'
string
'
)
{
updateNew
(
accountUpdate
:
Object
,
recalculateAddress
:
boolean
=
true
)
{
// Object.assign(this.state.newAccount, accountUpdate);
// const { seed } = this.state.newAccount;
// if (typeof seed === 'string') {
// debounce(async () => {
// const { bip39, address } = await brainWalletAddress(seed);
// Object.assign(this.state.newAccount, { address, validBip39Seed: bip39 });
// this.setState({});
// }, 200)();
// }
// this.setState({});
const
{
newAccount
}
=
this
.
state
;
const
{
seed
}
=
accountUpdate
;
console
.
log
(
'
hop
'
,
accountUpdate
)
if
(
seed
&&
recalculateAddress
){
this
.
setState
({
newAccount
:{...
newAccount
,
seed
}});
debounce
(
async
()
=>
{
const
{
bip39
,
address
}
=
await
brainWalletAddress
(
seed
);
Object
.
assign
(
this
.
state
.
newAccount
,
{
address
,
validBip39Seed
:
bip39
});
this
.
setState
({});
},
200
)();
console
.
log
(
'
back
'
,{
newAccount
:
{...
newAccount
,
...
accountUpdate
,
address
,
validBip39Seed
:
bip39
}
})
this
.
setState
({
newAccount
:
{...
newAccount
,
...
accountUpdate
,
address
,
validBip39Seed
:
bip39
}
})
console
.
log
(
'
we update to
'
,{
newAccount
:
{...
newAccount
,
...
accountUpdate
,
address
,
validBip39Seed
:
bip39
}
})
},
200
)()
}
else
{
this
.
setState
({
newAccount
:
{...
newAccount
,
...
accountUpdate
}
})
console
.
log
(
'
without calculation
'
,{
newAccount
:
{...
newAccount
,
...
accountUpdate
}
})
}
this
.
setState
({});
}
getNew
():
Account
{
...
...
Thibaut Sardan
@Tbaut
mentioned in commit
30d65273
·
Jul 25, 2019
mentioned in commit
30d65273
mentioned in commit 30d65273d94af400bd2972fa4ca0b6b22cc971ba
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment