diff options
Diffstat (limited to 'ui/app/accounts')
-rw-r--r-- | ui/app/accounts/account-list-item.js | 2 | ||||
-rw-r--r-- | ui/app/accounts/index.js | 22 |
2 files changed, 10 insertions, 14 deletions
diff --git a/ui/app/accounts/account-list-item.js b/ui/app/accounts/account-list-item.js index 4e0d69ed7..ef7b749e4 100644 --- a/ui/app/accounts/account-list-item.js +++ b/ui/app/accounts/account-list-item.js @@ -16,7 +16,7 @@ function AccountListItem () { AccountListItem.prototype.render = function () { const identity = this.props.identity - var isSelected = this.props.selectedAddress === identity.address + var isSelected = this.props.selectedAccount === identity.address var account = this.props.accounts[identity.address] const selectedClass = isSelected ? '.selected' : '' diff --git a/ui/app/accounts/index.js b/ui/app/accounts/index.js index 7551c498e..fcb3a7b0f 100644 --- a/ui/app/accounts/index.js +++ b/ui/app/accounts/index.js @@ -19,7 +19,7 @@ function mapStateToProps (state) { accounts: state.metamask.accounts, identities: state.metamask.identities, unconfTxs: state.metamask.unconfTxs, - selectedAddress: state.metamask.selectedAddress, + selectedAccount: state.metamask.selectedAccount, scrollToBottom: state.appState.scrollToBottom, pending, } @@ -34,11 +34,7 @@ AccountsScreen.prototype.render = function () { var state = this.props var identityList = valuesFor(state.identities) var unconfTxList = valuesFor(state.unconfTxs) - var actions = { - onSelect: this.onSelect.bind(this), - onShowDetail: this.onShowDetail.bind(this), - goHome: this.goHome.bind(this), - } + return ( h('.accounts-section.flex-grow', [ @@ -46,7 +42,7 @@ AccountsScreen.prototype.render = function () { // subtitle and nav h('.section-title.flex-center', [ h('i.fa.fa-arrow-left.fa-lg.cursor-pointer', { - onClick: actions.goHome, + onClick: this.goHome.bind(this), }), h('h2.page-subtitle', 'Select Account'), ]), @@ -76,7 +72,7 @@ AccountsScreen.prototype.render = function () { return h(AccountListItem, { key: `acct-panel-${identity.address}`, identity, - selectedAddress: this.props.selectedAddress, + selectedAccount: this.props.selectedAccount, accounts: this.props.accounts, onShowDetail: this.onShowDetail.bind(this), pending, @@ -87,7 +83,7 @@ AccountsScreen.prototype.render = function () { h('div.footer.hover-white.pointer', { key: 'reveal-account-bar', onClick: () => { - this.onRevealAccount() + this.addNewAccount() }, style: { display: 'flex', @@ -137,8 +133,8 @@ AccountsScreen.prototype.navigateToConfTx = function () { AccountsScreen.prototype.onSelect = function (address, event) { event.stopPropagation() // if already selected, deselect - if (this.props.selectedAddress === address) address = null - this.props.dispatch(actions.setSelectedAddress(address)) + if (this.props.selectedAccount === address) address = null + this.props.dispatch(actions.setSelectedAccount(address)) } AccountsScreen.prototype.onShowDetail = function (address, event) { @@ -146,8 +142,8 @@ AccountsScreen.prototype.onShowDetail = function (address, event) { this.props.dispatch(actions.showAccountDetail(address)) } -AccountsScreen.prototype.onRevealAccount = function () { - this.props.dispatch(actions.revealAccount()) +AccountsScreen.prototype.addNewAccount = function () { + this.props.dispatch(actions.addNewAccount(0)) } AccountsScreen.prototype.goHome = function () { |