aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/account-dropdowns.js
diff options
context:
space:
mode:
authorKevin Serrano <kevin.serrano@consensys.net>2017-09-14 23:35:48 +0800
committerKevin Serrano <kevin.serrano@consensys.net>2017-09-14 23:35:48 +0800
commitcb8856597cb650e282e7209f43547a5f9328de28 (patch)
tree842b64aea519c7041bc4fbf2a6f31f5d17f57cb8 /ui/app/components/account-dropdowns.js
parent162aedb30b94890935658921b0dd399f43d6cd65 (diff)
parent1d3cd9768cdd372d02e7e34674dde9d86af536f5 (diff)
downloadtangerine-wallet-browser-cb8856597cb650e282e7209f43547a5f9328de28.tar.gz
tangerine-wallet-browser-cb8856597cb650e282e7209f43547a5f9328de28.tar.zst
tangerine-wallet-browser-cb8856597cb650e282e7209f43547a5f9328de28.zip
Merge branch 'master' into new-currency-test
Diffstat (limited to 'ui/app/components/account-dropdowns.js')
-rw-r--r--ui/app/components/account-dropdowns.js21
1 files changed, 20 insertions, 1 deletions
diff --git a/ui/app/components/account-dropdowns.js b/ui/app/components/account-dropdowns.js
index 7c24e70bd..b087a40d4 100644
--- a/ui/app/components/account-dropdowns.js
+++ b/ui/app/components/account-dropdowns.js
@@ -22,12 +22,19 @@ class AccountDropdowns extends Component {
}
renderAccounts () {
- const { identities, selected } = this.props
+ const { identities, selected, keyrings } = this.props
return Object.keys(identities).map((key, index) => {
const identity = identities[key]
const isSelected = identity.address === selected
+ const simpleAddress = identity.address.substring(2).toLowerCase()
+
+ const keyring = keyrings.find((kr) => {
+ return kr.accounts.includes(simpleAddress) ||
+ kr.accounts.includes(identity.address)
+ })
+
return h(
DropdownMenuItem,
{
@@ -51,6 +58,7 @@ class AccountDropdowns extends Component {
},
},
),
+ this.indicateIfLoose(keyring),
h('span', {
style: {
marginLeft: '20px',
@@ -67,6 +75,14 @@ class AccountDropdowns extends Component {
})
}
+ indicateIfLoose (keyring) {
+ try { // Sometimes keyrings aren't loaded yet:
+ const type = keyring.type
+ const isLoose = type !== 'HD Key Tree'
+ return isLoose ? h('.keyring-label', 'LOOSE') : null
+ } catch (e) { return }
+ }
+
renderAccountSelector () {
const { actions } = this.props
const { accountSelectorActive } = this.state
@@ -145,6 +161,8 @@ class AccountDropdowns extends Component {
)
}
+
+
renderAccountOptions () {
const { actions } = this.props
const { optionsMenuActive } = this.state
@@ -278,6 +296,7 @@ AccountDropdowns.defaultProps = {
AccountDropdowns.propTypes = {
identities: PropTypes.objectOf(PropTypes.object),
selected: PropTypes.string,
+ keyrings: PropTypes.array,
}
const mapDispatchToProps = (dispatch) => {