aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWhymarrh Whitby <whymarrh.whitby@gmail.com>2018-06-06 03:23:30 +0800
committerWhymarrh Whitby <whymarrh.whitby@gmail.com>2018-06-06 03:25:06 +0800
commit665ac860e5d29c573e07161632b0043ba18ef1d4 (patch)
treee8258f7d48a637cd46d17ea89068f07084c10855
parent762695bfd943a8910e4f297a66d9b8cd44eb8579 (diff)
downloadtangerine-wallet-browser-665ac860e5d29c573e07161632b0043ba18ef1d4.tar.gz
tangerine-wallet-browser-665ac860e5d29c573e07161632b0043ba18ef1d4.tar.zst
tangerine-wallet-browser-665ac860e5d29c573e07161632b0043ba18ef1d4.zip
Remove selectedIdentity prop from wallet view
The selectedIdentity property is computed based on the selectedAddress which means that using both the selectedAddress and the selectedIdentity is redundant. In the case of the Array#find call on the set of keyrings, we wouldn't have a situation where one is included and the other isn't. This changeset removes the selectedIdentity from the wallet view because it isn't needed.
-rw-r--r--ui/app/components/wallet-view.js8
1 files changed, 3 insertions, 5 deletions
diff --git a/ui/app/components/wallet-view.js b/ui/app/components/wallet-view.js
index 538175cdf..da142fad8 100644
--- a/ui/app/components/wallet-view.js
+++ b/ui/app/components/wallet-view.js
@@ -36,7 +36,6 @@ function mapStateToProps (state) {
tokens: state.metamask.tokens,
keyrings: state.metamask.keyrings,
selectedAddress: selectors.getSelectedAddress(state),
- selectedIdentity: selectors.getSelectedIdentity(state),
selectedAccount: selectors.getSelectedAccount(state),
selectedTokenAddress: state.metamask.selectedTokenAddress,
}
@@ -99,12 +98,12 @@ WalletView.prototype.render = function () {
const {
responsiveDisplayClassname,
selectedAddress,
- selectedIdentity,
keyrings,
showAccountDetailModal,
sidebarOpen,
hideSidebar,
history,
+ identities,
} = this.props
// temporary logs + fake extra wallets
// console.log('walletview, selectedAccount:', selectedAccount)
@@ -116,8 +115,7 @@ WalletView.prototype.render = function () {
}
const keyring = keyrings.find((kr) => {
- return kr.accounts.includes(selectedAddress) ||
- kr.accounts.includes(selectedIdentity.address)
+ return kr.accounts.includes(selectedAddress)
})
const type = keyring.type
@@ -149,7 +147,7 @@ WalletView.prototype.render = function () {
h('span.account-name', {
style: {},
}, [
- selectedIdentity.name,
+ identities[selectedAddress].name,
]),
h('button.btn-clear.wallet-view__details-button.allcaps', this.context.t('details')),