diff options
author | Dan Miller <danjm.com@gmail.com> | 2018-11-14 02:25:34 +0800 |
---|---|---|
committer | Dan Miller <danjm.com@gmail.com> | 2018-12-04 11:36:22 +0800 |
commit | 75d75454374d98bf904b817bc2dd2b81b9e97a9d (patch) | |
tree | c356b89563670fe1077a08bb43044d559dfb26a5 | |
parent | f8ffdaedc9a8fac631deafbc1d377430c980af94 (diff) | |
download | tangerine-wallet-browser-75d75454374d98bf904b817bc2dd2b81b9e97a9d.tar tangerine-wallet-browser-75d75454374d98bf904b817bc2dd2b81b9e97a9d.tar.gz tangerine-wallet-browser-75d75454374d98bf904b817bc2dd2b81b9e97a9d.tar.bz2 tangerine-wallet-browser-75d75454374d98bf904b817bc2dd2b81b9e97a9d.tar.lz tangerine-wallet-browser-75d75454374d98bf904b817bc2dd2b81b9e97a9d.tar.xz tangerine-wallet-browser-75d75454374d98bf904b817bc2dd2b81b9e97a9d.tar.zst tangerine-wallet-browser-75d75454374d98bf904b817bc2dd2b81b9e97a9d.zip |
Clear custom gas data on hiding of gas customization modal.
-rw-r--r-- | ui/app/components/modals/modal.js | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/ui/app/components/modals/modal.js b/ui/app/components/modals/modal.js index 46347312c..7ed0b6944 100644 --- a/ui/app/components/modals/modal.js +++ b/ui/app/components/modals/modal.js @@ -4,6 +4,7 @@ const inherits = require('util').inherits const connect = require('react-redux').connect const FadeModal = require('boron').FadeModal const actions = require('../../actions') +const { resetCustomData: resetCustomGasData } = require('../../ducks/gas.duck') const isMobileView = require('../../../lib/is-mobile-view') const { getEnvironmentType } = require('../../../../app/scripts/lib/util') const { ENVIRONMENT_TYPE_POPUP } = require('../../../../app/scripts/lib/enums') @@ -317,6 +318,10 @@ const MODALS = { contentStyle: { borderRadius: '8px', }, + customOnHideOpts: { + action: resetCustomGasData, + args: [], + }, }, TRANSACTION_CONFIRMED: { @@ -392,8 +397,11 @@ function mapStateToProps (state) { function mapDispatchToProps (dispatch) { return { - hideModal: () => { + hideModal: (customOnHideOpts) => { dispatch(actions.hideModal()) + if (customOnHideOpts.action) { + dispatch(customOnHideOpts.action(...customOnHideOpts.args)) + } }, hideWarning: () => { dispatch(actions.hideWarning()) @@ -425,7 +433,7 @@ Modal.prototype.render = function () { if (modal.onHide) { modal.onHide(this.props) } - this.onHide() + this.onHide(modal.customOnHideOpts) }, ref: (ref) => { this.modalRef = ref @@ -447,11 +455,11 @@ Modal.prototype.componentWillReceiveProps = function (nextProps) { } } -Modal.prototype.onHide = function () { +Modal.prototype.onHide = function (customOnHideOpts) { if (this.props.onHideCallback) { this.props.onHideCallback() } - this.props.hideModal() + this.props.hideModal(customOnHideOpts) } Modal.prototype.hide = function () { |