1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Use .entries() instead of .keys(), and use more destructuring, for simpler code.

This commit is contained in:
Dan 2017-09-05 11:57:28 -02:30 committed by Chi Kei Chan
parent 78f39bcce6
commit 562d2fadae

View File

@ -193,20 +193,19 @@ SendTransactionScreen.prototype.render = function () {
h('datalist#addresses', {}, [ h('datalist#addresses', {}, [
// Corresponds to the addresses owned. // Corresponds to the addresses owned.
Object.keys(props.identities).map((key) => { Object.entries(props.identities).map(([key, { address, name }]) => {
const identity = props.identities[key]
return h('option', { return h('option', {
value: identity.address, value: address,
label: identity.name, label: name,
key: identity.address, key: address,
}) })
}), }),
// Corresponds to previously sent-to addresses. // Corresponds to previously sent-to addresses.
props.addressBook.map((identity) => { props.addressBook.map(({ address, name }) => {
return h('option', { return h('option', {
value: identity.address, value: address,
label: identity.name, label: name,
key: identity.address, key: address,
}) })
}), }),
]), ]),