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
30d65273
Commit
30d65273
authored
Jul 25, 2019
by
Thibaut Sardan
Browse files
Revert "fix(): init"
This reverts commit
b62b983d
.
parent
d273f796
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/components/AccountIconChooser.js
View file @
30d65273
...
...
@@ -56,12 +56,11 @@ export default class AccountIconChooser extends React.PureComponent<{
.
split
(
'
'
)
.
map
(
async
()
=>
{
const
seed
=
await
words
();
const
{
address
,
bip39
}
=
await
brainWalletAddress
(
seed
);
const
{
address
}
=
await
brainWalletAddress
(
seed
);
return
{
address
,
seed
,
bip39
address
};
})
);
...
...
@@ -76,7 +75,6 @@ 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
];
...
...
@@ -86,9 +84,8 @@ export default class AccountIconChooser extends React.PureComponent<{
style
=
{[
styles
.
iconBorder
,
iSelected
?
styles
.
selected
:
{}]}
onPress
=
{()
=>
onChange
({
address
,
seed
,
bip39
address
:
item
.
address
,
seed
:
item
.
seed
})
}
>
...
...
src/screens/AccountNew.js
View file @
30d65273
...
...
@@ -73,8 +73,8 @@ class AccountNewView extends React.Component {
<
/Text
>
<
AccountIconChooser
value
=
{
selected
&&
selected
.
seed
&&
selected
.
address
}
onChange
=
{({
address
,
seed
,
bip39
})
=>
{
accounts
.
updateNew
({
address
,
seed
,
validBip39Seed
:
bip39
},
false
);
onChange
=
{({
address
,
seed
})
=>
{
accounts
.
updateNew
({
address
,
seed
}
);
}}
/
>
<
Text
style
=
{
styles
.
title
}
>
ACCOUNT
NAME
<
/Text
>
...
...
src/stores/AccountsStore.js
View file @
30d65273
...
...
@@ -65,35 +65,18 @@ export default class AccountsStore extends Container<AccountsState> {
});
}
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
}});
updateNew
(
accountUpdate
:
Object
)
{
Object
.
assign
(
this
.
state
.
newAccount
,
accountUpdate
);
const
{
seed
}
=
this
.
state
.
newAccount
;
if
(
typeof
seed
===
'
string
'
)
{
debounce
(
async
()
=>
{
const
{
bip39
,
address
}
=
await
brainWalletAddress
(
seed
);
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
}
})
Object
.
assign
(
this
.
state
.
newAccount
,
{
address
,
validBip39Seed
:
bip39
});
this
.
setState
({});
},
200
)();
}
this
.
setState
({});
}
getNew
():
Account
{
...
...
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