diff options
Diffstat (limited to 'ui/app/components/signature-request.js')
-rw-r--r-- | ui/app/components/signature-request.js | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/ui/app/components/signature-request.js b/ui/app/components/signature-request.js index b76c1e60f..92feb70ba 100644 --- a/ui/app/components/signature-request.js +++ b/ui/app/components/signature-request.js @@ -5,6 +5,8 @@ const Identicon = require('./identicon') const connect = require('../metamask-connect') const ethUtil = require('ethereumjs-util') const classnames = require('classnames') +const { compose } = require('recompose') +const { withRouter } = require('react-router-dom') const AccountDropdownMini = require('./dropdowns/account-dropdown-mini') @@ -19,6 +21,8 @@ const { conversionRateSelector, } = require('../selectors.js') +const { DEFAULT_ROUTE } = require('../routes') + function mapStateToProps (state) { return { balance: getSelectedAccount(state).balance, @@ -37,7 +41,10 @@ function mapDispatchToProps (dispatch) { } } -module.exports = connect(mapStateToProps, mapDispatchToProps)(SignatureRequest) +module.exports = compose( + withRouter, + connect(mapStateToProps, mapDispatchToProps) +)(SignatureRequest) inherits(SignatureRequest, Component) function SignatureRequest (props) { @@ -223,10 +230,14 @@ SignatureRequest.prototype.renderFooter = function () { return h('div.request-signature__footer', [ h('button.btn-secondary--lg.request-signature__footer__cancel-button', { - onClick: cancel, + onClick: event => { + cancel(event).then(() => this.props.history.push(DEFAULT_ROUTE)) + }, }, this.props.t('cancel')), h('button.btn-primary--lg', { - onClick: sign, + onClick: event => { + sign(event).then(() => this.props.history.push(DEFAULT_ROUTE)) + }, }, this.props.t('sign')), ]) } |