aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/modals/hide-token-confirmation-modal.js
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2017-10-04 01:25:52 +0800
committerChi Kei Chan <chikeichan@gmail.com>2017-10-04 06:46:01 +0800
commitac4868170f4c61d13291389d01bf1002fe240ed4 (patch)
treed4000928e6b890d99d28b8109ad82cde7bf82fce /ui/app/components/modals/hide-token-confirmation-modal.js
parent45dbd017e65e5698db4580c77d723bface0e9b63 (diff)
downloadtangerine-wallet-browser-ac4868170f4c61d13291389d01bf1002fe240ed4.tar
tangerine-wallet-browser-ac4868170f4c61d13291389d01bf1002fe240ed4.tar.gz
tangerine-wallet-browser-ac4868170f4c61d13291389d01bf1002fe240ed4.tar.bz2
tangerine-wallet-browser-ac4868170f4c61d13291389d01bf1002fe240ed4.tar.lz
tangerine-wallet-browser-ac4868170f4c61d13291389d01bf1002fe240ed4.tar.xz
tangerine-wallet-browser-ac4868170f4c61d13291389d01bf1002fe240ed4.tar.zst
tangerine-wallet-browser-ac4868170f4c61d13291389d01bf1002fe240ed4.zip
Enables remove token and ensures add/remove update the list without need for refresh.
Diffstat (limited to 'ui/app/components/modals/hide-token-confirmation-modal.js')
-rw-r--r--ui/app/components/modals/hide-token-confirmation-modal.js16
1 files changed, 12 insertions, 4 deletions
diff --git a/ui/app/components/modals/hide-token-confirmation-modal.js b/ui/app/components/modals/hide-token-confirmation-modal.js
index d3f06b483..fa3ad0b1e 100644
--- a/ui/app/components/modals/hide-token-confirmation-modal.js
+++ b/ui/app/components/modals/hide-token-confirmation-modal.js
@@ -13,7 +13,15 @@ function mapStateToProps (state) {
}
function mapDispatchToProps (dispatch) {
- return {}
+ return {
+ hideModal: () => dispatch(actions.hideModal()),
+ hideToken: address => {
+ dispatch(actions.removeToken(address))
+ .then(() => {
+ dispatch(actions.hideModal())
+ })
+ },
+ }
}
inherits(HideTokenConfirmationModal, Component)
@@ -26,7 +34,7 @@ function HideTokenConfirmationModal () {
module.exports = connect(mapStateToProps, mapDispatchToProps)(HideTokenConfirmationModal)
HideTokenConfirmationModal.prototype.render = function () {
- const { token, network } = this.props
+ const { token, network, hideToken, hideModal } = this.props
const { symbol, address } = token
return h('div.hide-token-confirmation', {}, [
@@ -51,12 +59,12 @@ HideTokenConfirmationModal.prototype.render = function () {
h('div.hide-token-confirmation__buttons', {}, [
h('button.btn-clear', {
- onClick: () => {},
+ onClick: () => hideModal(),
}, [
'CANCEL',
]),
h('button.btn-clear', {
- onClick: () => {},
+ onClick: () => hideToken(address),
}, [
'HIDE',
]),