From 376ae032fedb99d22b7c71438ec9482d2013c78e Mon Sep 17 00:00:00 2001 From: Chi Kei Chan Date: Thu, 19 Oct 2017 12:47:44 -0700 Subject: Fix selectors --- ui/app/app.js | 1 - ui/app/components/account-menu/index.js | 5 ++--- ui/app/components/wallet-view.js | 4 ++-- ui/app/selectors.js | 4 ++-- 4 files changed, 6 insertions(+), 8 deletions(-) (limited to 'ui') diff --git a/ui/app/app.js b/ui/app/app.js index de6a06a58..cf82248e4 100644 --- a/ui/app/app.js +++ b/ui/app/app.js @@ -207,7 +207,6 @@ App.prototype.renderAppBar = function () { if (window.METAMASK_UI_TYPE === 'notification') { return null } - console.log(this.props) return ( h('.full-width', { diff --git a/ui/app/components/account-menu/index.js b/ui/app/components/account-menu/index.js index 2ebdba24a..85bd21076 100644 --- a/ui/app/components/account-menu/index.js +++ b/ui/app/components/account-menu/index.js @@ -35,7 +35,6 @@ function mapDispatchToProps (dispatch) { dispatch(actions.toggleAccountMenu()) }, showConfigPage: () => { - console.log('hihihih') dispatch(actions.showConfigPage()) dispatch(actions.toggleAccountMenu()) }, @@ -60,7 +59,6 @@ AccountMenu.prototype.render = function () { showConfigPage, } = this.props - console.log(showConfigPage) return h(Menu, { className: 'account-menu', isShowing: isAccountMenuOpen }, [ h(CloseArea, { onClick: toggleAccountMenu }), h(Item, { @@ -105,11 +103,12 @@ AccountMenu.prototype.renderAccounts = function () { showAccountDetail, } = this.props + console.log({ accounts }) return Object.keys(identities).map((key, index) => { const identity = identities[key] const isSelected = identity.address === selected - const balanceValue = accounts[key].balance + const balanceValue = accounts[key] ? accounts[key].balance : '' const formattedBalance = balanceValue ? formatBalance(balanceValue, 6) : '...' const simpleAddress = identity.address.substring(2).toLowerCase() diff --git a/ui/app/components/wallet-view.js b/ui/app/components/wallet-view.js index f06c4d512..a870a24e3 100644 --- a/ui/app/components/wallet-view.js +++ b/ui/app/components/wallet-view.js @@ -47,7 +47,7 @@ WalletView.prototype.renderWalletBalance = function () { hideSidebar, sidebarOpen, } = this.props - + console.log({ selectedAccount }) const selectedClass = selectedTokenAddress ? '' : 'wallet-balance-wrapper--active' @@ -63,7 +63,7 @@ WalletView.prototype.renderWalletBalance = function () { }, [ h(BalanceComponent, { - balanceValue: selectedAccount.balance, + balanceValue: selectedAccount ? selectedAccount.balance : '', style: {}, }), ] diff --git a/ui/app/selectors.js b/ui/app/selectors.js index 66b7c00e4..4c3d21d33 100644 --- a/ui/app/selectors.js +++ b/ui/app/selectors.js @@ -67,7 +67,7 @@ function getTokenExchangeRate (state, tokenSymbol) { return tokenExchangeRate } -function conversionRateSelector (state) { +function conversionRateSelector (state) { return state.metamask.conversionRate } @@ -102,7 +102,7 @@ function transactionsSelector (state) { const transactions = state.metamask.selectedAddressTxList || [] const txsToRender = !shapeShiftTxList ? transactions.concat(unapprovedMsgs) : transactions.concat(unapprovedMsgs, shapeShiftTxList) - console.log({txsToRender, selectedTokenAddress}) + // console.log({txsToRender, selectedTokenAddress}) return selectedTokenAddress ? txsToRender .filter(({ txParams: { to } }) => to === selectedTokenAddress) -- cgit