aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/buy-button-subview.js
diff options
context:
space:
mode:
authorDan Finlay <somniac@me.com>2016-09-16 06:00:42 +0800
committerGitHub <noreply@github.com>2016-09-16 06:00:42 +0800
commita5e45820cc7359491d1d7b06a5358d99b9c97305 (patch)
tree521c1baf581454c29b05c53a6598d5ec6fe8caa4 /ui/app/components/buy-button-subview.js
parent06b9adf172010600c7ac1127ff2ee76a7433e97b (diff)
parentcf484d735fab021a0dfe509243b957e8c6278532 (diff)
downloadtangerine-wallet-browser-a5e45820cc7359491d1d7b06a5358d99b9c97305.tar
tangerine-wallet-browser-a5e45820cc7359491d1d7b06a5358d99b9c97305.tar.gz
tangerine-wallet-browser-a5e45820cc7359491d1d7b06a5358d99b9c97305.tar.bz2
tangerine-wallet-browser-a5e45820cc7359491d1d7b06a5358d99b9c97305.tar.lz
tangerine-wallet-browser-a5e45820cc7359491d1d7b06a5358d99b9c97305.tar.xz
tangerine-wallet-browser-a5e45820cc7359491d1d7b06a5358d99b9c97305.tar.zst
tangerine-wallet-browser-a5e45820cc7359491d1d7b06a5358d99b9c97305.zip
Merge pull request #673 from MetaMask/i#519buyButtonTxConf
Drop the buy button in if tx is more then account balance
Diffstat (limited to 'ui/app/components/buy-button-subview.js')
-rw-r--r--ui/app/components/buy-button-subview.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/ui/app/components/buy-button-subview.js b/ui/app/components/buy-button-subview.js
index c3e9e5d7b..7daf41206 100644
--- a/ui/app/components/buy-button-subview.js
+++ b/ui/app/components/buy-button-subview.js
@@ -16,6 +16,7 @@ function mapStateToProps (state) {
buyView: state.appState.buyView,
network: state.metamask.network,
provider: state.metamask.provider,
+ context: state.appState.currentView.context,
}
}
@@ -38,7 +39,7 @@ BuyButtonSubview.prototype.render = function () {
},
}, [
h('i.fa.fa-arrow-left.fa-lg.cursor-pointer.color-orange', {
- onClick: () => props.dispatch(actions.backToAccountDetail(props.selectedAccount)),
+ onClick: this.backButtonContext.bind(this),
style: {
position: 'absolute',
left: '10px',
@@ -121,3 +122,11 @@ BuyButtonSubview.prototype.formVersionSubview = function () {
BuyButtonSubview.prototype.navigateTo = function (url) {
extension.tabs.create({ url })
}
+
+BuyButtonSubview.prototype.backButtonContext = function () {
+ if (this.props.context === 'confTx') {
+ this.props.dispatch(actions.showConfTxPage(false))
+ } else {
+ this.props.dispatch(actions.goHome())
+ }
+}