diff options
author | kumavis <kumavis@users.noreply.github.com> | 2018-06-06 03:57:24 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-06 03:57:24 +0800 |
commit | c2e3194dbf4e2a3fd2bdffb3300ec0cd822dc78e (patch) | |
tree | c2a9e3c68605ca4b5a8feaf0d2f0cb6677d78b15 | |
parent | 5b3af3413948493ca92206d2145a984950a96549 (diff) | |
parent | 665ac860e5d29c573e07161632b0043ba18ef1d4 (diff) | |
download | tangerine-wallet-browser-c2e3194dbf4e2a3fd2bdffb3300ec0cd822dc78e.tar tangerine-wallet-browser-c2e3194dbf4e2a3fd2bdffb3300ec0cd822dc78e.tar.gz tangerine-wallet-browser-c2e3194dbf4e2a3fd2bdffb3300ec0cd822dc78e.tar.bz2 tangerine-wallet-browser-c2e3194dbf4e2a3fd2bdffb3300ec0cd822dc78e.tar.lz tangerine-wallet-browser-c2e3194dbf4e2a3fd2bdffb3300ec0cd822dc78e.tar.xz tangerine-wallet-browser-c2e3194dbf4e2a3fd2bdffb3300ec0cd822dc78e.tar.zst tangerine-wallet-browser-c2e3194dbf4e2a3fd2bdffb3300ec0cd822dc78e.zip |
Merge pull request #4509 from whymarrh/wallet-view-assertion
Add explicit selectedAddress assertion to the wallet view
-rw-r--r-- | ui/app/components/wallet-view.js | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/ui/app/components/wallet-view.js b/ui/app/components/wallet-view.js index 3b29dacac..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,21 +98,24 @@ 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) const checksummedAddress = checksumAddress(selectedAddress) + if (!selectedAddress) { + throw new Error('selectedAddress should not be ' + String(selectedAddress)) + } + const keyring = keyrings.find((kr) => { - return kr.accounts.includes(selectedAddress) || - kr.accounts.includes(selectedIdentity.address) + return kr.accounts.includes(selectedAddress) }) const type = keyring.type @@ -145,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')), |