diff options
author | Frankie <frankie.diamond@gmail.com> | 2019-01-30 02:13:51 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-30 02:13:51 +0800 |
commit | df3169d1c7250d13bb8bc123dc91f7913ad75a81 (patch) | |
tree | 266721dc67ae2079543f9ba78e7c546e24f1d068 /ui/app/components/pages | |
parent | 98d5b4d63217094db9dfc535d0baaed7f8ab0520 (diff) | |
download | tangerine-wallet-browser-df3169d1c7250d13bb8bc123dc91f7913ad75a81.tar tangerine-wallet-browser-df3169d1c7250d13bb8bc123dc91f7913ad75a81.tar.gz tangerine-wallet-browser-df3169d1c7250d13bb8bc123dc91f7913ad75a81.tar.bz2 tangerine-wallet-browser-df3169d1c7250d13bb8bc123dc91f7913ad75a81.tar.lz tangerine-wallet-browser-df3169d1c7250d13bb8bc123dc91f7913ad75a81.tar.xz tangerine-wallet-browser-df3169d1c7250d13bb8bc123dc91f7913ad75a81.tar.zst tangerine-wallet-browser-df3169d1c7250d13bb8bc123dc91f7913ad75a81.zip |
I#5956 fix2 dont overwrite existing rpc settings (#6044)
* mm-controller - dont overwrite existing rpc settings
* ui-networkDropdown - dont pass old network as chainId
* add methods preferencesController.updateRpc and metamaskController.updateAndSetCustomRpc
* use updateAndSetCustomRpc in settings to allow rpcs to be updated
* use new rpc as nickname if no nick name has been supplied
* fix update rpc method
Diffstat (limited to 'ui/app/components/pages')
-rw-r--r-- | ui/app/components/pages/settings/settings-tab/settings-tab.component.js | 1 | ||||
-rw-r--r-- | ui/app/components/pages/settings/settings-tab/settings-tab.container.js | 4 |
2 files changed, 2 insertions, 3 deletions
diff --git a/ui/app/components/pages/settings/settings-tab/settings-tab.component.js b/ui/app/components/pages/settings/settings-tab/settings-tab.component.js index 16afa85cb..8cd596423 100644 --- a/ui/app/components/pages/settings/settings-tab/settings-tab.component.js +++ b/ui/app/components/pages/settings/settings-tab/settings-tab.component.js @@ -230,7 +230,6 @@ export default class SettingsTab extends PureComponent { validateRpc (newRpc, chainId, ticker = 'ETH', nickname) { const { setRpcTarget, displayWarning } = this.props - if (validUrl.isWebUri(newRpc)) { if (!!chainId && Number.isNaN(parseInt(chainId))) { return displayWarning(`${this.context.t('invalidInput')} chainId`) diff --git a/ui/app/components/pages/settings/settings-tab/settings-tab.container.js b/ui/app/components/pages/settings/settings-tab/settings-tab.container.js index b6c33a5b2..d5fd8416a 100644 --- a/ui/app/components/pages/settings/settings-tab/settings-tab.container.js +++ b/ui/app/components/pages/settings/settings-tab/settings-tab.container.js @@ -4,7 +4,7 @@ import { connect } from 'react-redux' import { withRouter } from 'react-router-dom' import { setCurrentCurrency, - setRpcTarget, + updateAndSetCustomRpc, displayWarning, revealSeedConfirmation, setUseBlockie, @@ -50,7 +50,7 @@ const mapStateToProps = state => { const mapDispatchToProps = dispatch => { return { setCurrentCurrency: currency => dispatch(setCurrentCurrency(currency)), - setRpcTarget: (newRpc, chainId, ticker, nickname) => dispatch(setRpcTarget(newRpc, chainId, ticker, nickname)), + setRpcTarget: (newRpc, chainId, ticker, nickname) => dispatch(updateAndSetCustomRpc(newRpc, chainId, ticker, nickname)), displayWarning: warning => dispatch(displayWarning(warning)), revealSeedConfirmation: () => dispatch(revealSeedConfirmation()), setUseBlockie: value => dispatch(setUseBlockie(value)), |