diff options
Diffstat (limited to 'ui/app/send.js')
-rw-r--r-- | ui/app/send.js | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/ui/app/send.js b/ui/app/send.js index a2ce696cf..eb32d5e06 100644 --- a/ui/app/send.js +++ b/ui/app/send.js @@ -20,6 +20,7 @@ function mapStateToProps (state) { identities: state.metamask.identities, warning: state.appState.warning, network: state.metamask.network, + addressBook: state.metamask.addressBook, } result.error = result.warning && result.warning.split('.')[0] @@ -45,6 +46,7 @@ SendTransactionScreen.prototype.render = function () { var identity = state.identity var network = state.network var identities = state.identities + var addressBook = state.addressBook return ( @@ -155,6 +157,7 @@ SendTransactionScreen.prototype.render = function () { onChange: this.recipientDidChange.bind(this), network, identities, + addressBook, }), ]), @@ -224,13 +227,17 @@ SendTransactionScreen.prototype.back = function () { this.props.dispatch(actions.backToAccountDetail(address)) } -SendTransactionScreen.prototype.recipientDidChange = function (recipient) { - this.setState({ recipient }) +SendTransactionScreen.prototype.recipientDidChange = function (recipient, nickname) { + this.setState({ + recipient: recipient, + nickname: nickname, + }) } SendTransactionScreen.prototype.onSubmit = function () { const state = this.state || {} const recipient = state.recipient || document.querySelector('input[name="address"]').value + const nickname = state.nickname || ' ' const input = document.querySelector('input[name="amount"]').value const value = util.normalizeEthStringToWei(input) const txData = document.querySelector('input[name="txData"]').value @@ -259,6 +266,8 @@ SendTransactionScreen.prototype.onSubmit = function () { this.props.dispatch(actions.hideWarning()) + this.props.dispatch(actions.addToAddressBook(recipient, nickname)) + var txParams = { from: this.props.address, value: '0x' + value.toString(16), |