aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorDan Finlay <542863+danfinlay@users.noreply.github.com>2018-04-24 06:14:23 +0800
committerGitHub <noreply@github.com>2018-04-24 06:14:23 +0800
commitf1c0d8ad6e5dd99dae723b9bc0ca80bed27e8bc1 (patch)
treeea619e13cace47b12133ffcaa6586c675a90f4e1 /ui
parent9679cdae02e0ad645ced1a8627ada68456dcbbdb (diff)
parentce74cd7774dbf2ecc7f9c9aa98f61fcd08fb6d39 (diff)
downloadtangerine-wallet-browser-f1c0d8ad6e5dd99dae723b9bc0ca80bed27e8bc1.tar
tangerine-wallet-browser-f1c0d8ad6e5dd99dae723b9bc0ca80bed27e8bc1.tar.gz
tangerine-wallet-browser-f1c0d8ad6e5dd99dae723b9bc0ca80bed27e8bc1.tar.bz2
tangerine-wallet-browser-f1c0d8ad6e5dd99dae723b9bc0ca80bed27e8bc1.tar.lz
tangerine-wallet-browser-f1c0d8ad6e5dd99dae723b9bc0ca80bed27e8bc1.tar.xz
tangerine-wallet-browser-f1c0d8ad6e5dd99dae723b9bc0ca80bed27e8bc1.tar.zst
tangerine-wallet-browser-f1c0d8ad6e5dd99dae723b9bc0ca80bed27e8bc1.zip
Merge pull request #4028 from MetaMask/i4016-customrpc
Fix custom RPC not redirecting to Settings page
Diffstat (limited to 'ui')
-rw-r--r--ui/app/components/dropdowns/network-dropdown.js14
1 files changed, 8 insertions, 6 deletions
diff --git a/ui/app/components/dropdowns/network-dropdown.js b/ui/app/components/dropdowns/network-dropdown.js
index 9e47f38ef..dcd6b4370 100644
--- a/ui/app/components/dropdowns/network-dropdown.js
+++ b/ui/app/components/dropdowns/network-dropdown.js
@@ -3,12 +3,14 @@ const PropTypes = require('prop-types')
const h = require('react-hyperscript')
const inherits = require('util').inherits
const connect = require('react-redux').connect
+const { withRouter } = require('react-router-dom')
+const { compose } = require('recompose')
const actions = require('../../actions')
const Dropdown = require('./components/dropdown').Dropdown
const DropdownMenuItem = require('./components/dropdown').DropdownMenuItem
const NetworkDropdownIcon = require('./components/network-dropdown-icon')
const R = require('ramda')
-
+const { SETTINGS_ROUTE } = require('../../routes')
// classes from nodes of the toggle element.
const notToggleElementClassnames = [
@@ -41,9 +43,6 @@ function mapDispatchToProps (dispatch) {
setRpcTarget: (target) => {
dispatch(actions.setRpcTarget(target))
},
- showConfigPage: () => {
- dispatch(actions.showConfigPage())
- },
showNetworkDropdown: () => dispatch(actions.showNetworkDropdown()),
hideNetworkDropdown: () => dispatch(actions.hideNetworkDropdown()),
}
@@ -59,7 +58,10 @@ NetworkDropdown.contextTypes = {
t: PropTypes.func,
}
-module.exports = connect(mapStateToProps, mapDispatchToProps)(NetworkDropdown)
+module.exports = compose(
+ withRouter,
+ connect(mapStateToProps, mapDispatchToProps)
+)(NetworkDropdown)
// TODO: specify default props and proptypes
@@ -227,7 +229,7 @@ NetworkDropdown.prototype.render = function () {
DropdownMenuItem,
{
closeMenu: () => this.props.hideNetworkDropdown(),
- onClick: () => this.props.showConfigPage(),
+ onClick: () => this.props.history.push(SETTINGS_ROUTE),
style: dropdownMenuItemStyle,
},
[