diff options
author | kumavis <kumavis@users.noreply.github.com> | 2016-06-30 01:02:35 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-30 01:02:35 +0800 |
commit | 8d9a0e71771db12757f8f9dc4c3682f5e377a6b6 (patch) | |
tree | 9fbf4a341b4ed39fa0796989f0d3e86e5d70e288 /ui | |
parent | e4956c3123a23cf4bddaf2617e36456735fddced (diff) | |
parent | ce03356f5f945aff293655fdaf7ee8be6b719acf (diff) | |
download | tangerine-wallet-browser-8d9a0e71771db12757f8f9dc4c3682f5e377a6b6.tar tangerine-wallet-browser-8d9a0e71771db12757f8f9dc4c3682f5e377a6b6.tar.gz tangerine-wallet-browser-8d9a0e71771db12757f8f9dc4c3682f5e377a6b6.tar.bz2 tangerine-wallet-browser-8d9a0e71771db12757f8f9dc4c3682f5e377a6b6.tar.lz tangerine-wallet-browser-8d9a0e71771db12757f8f9dc4c3682f5e377a6b6.tar.xz tangerine-wallet-browser-8d9a0e71771db12757f8f9dc4c3682f5e377a6b6.tar.zst tangerine-wallet-browser-8d9a0e71771db12757f8f9dc4c3682f5e377a6b6.zip |
Merge pull request #356 from MetaMask/networkDropdownFix
Network dropdown fix
Diffstat (limited to 'ui')
-rw-r--r-- | ui/app/app.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/ui/app/app.js b/ui/app/app.js index 8aab63a6a..8297ed796 100644 --- a/ui/app/app.js +++ b/ui/app/app.js @@ -46,6 +46,7 @@ function mapStateToProps (state) { unconfMsgs: state.metamask.unconfMsgs, menuOpen: state.appState.menuOpen, network: state.metamask.network, + provider: state.metamask.provider, } } @@ -228,6 +229,7 @@ App.prototype.renderNetworkDropdown = function () { action: () => props.dispatch(actions.setRpcTarget('http://localhost:8545')), icon: h('i.fa.fa-question-circle.fa-lg', { ariaHidden: true }), }), + this.renderCustomOption(props.provider.rpcTarget), ]) } @@ -355,3 +357,22 @@ App.prototype.toggleMetamaskActive = function () { this.props.dispatch(actions.lockMetamask(false)) } } + +App.prototype.renderCustomOption = function (rpcTarget) { + switch (rpcTarget) { + case undefined: + return h(DropMenuItem, { + label: 'Custom RPC', + closeMenu: () => this.setState({ isNetworkMenuOpen: false }), + action: () => this.props.dispatch(actions.showConfigPage()), + icon: h('i.fa.fa-question-circle.fa-lg', { ariaHidden: true }), + }) + + default: + return h(DropMenuItem, { + label: `${rpcTarget}`, + closeMenu: () => this.setState({ isNetworkMenuOpen: false }), + icon: h('i.fa.fa-question-circle.fa-lg', { ariaHidden: true }), + }) + } +} |