diff --git a/ui/app/helpers/utils/transactions.util.js b/ui/app/helpers/utils/transactions.util.js index d23c1777d0ef..99ccc3478ce7 100644 --- a/ui/app/helpers/utils/transactions.util.js +++ b/ui/app/helpers/utils/transactions.util.js @@ -192,7 +192,7 @@ export function getStatusKey (transaction) { } /** - * An external block explorer url at which a transaction can be viewed. + * Returns an external block explorer URL at which a transaction can be viewed. * @param {number} networkId * @param {string} hash * @param {Object} rpcPrefs diff --git a/ui/app/pages/settings/networks-tab/network-form/network-form.component.js b/ui/app/pages/settings/networks-tab/network-form/network-form.component.js index bb739dea1722..5e455b65eb1d 100644 --- a/ui/app/pages/settings/networks-tab/network-form/network-form.component.js +++ b/ui/app/pages/settings/networks-tab/network-form/network-form.component.js @@ -6,19 +6,19 @@ import TextField from '../../../../components/ui/text-field' export default class NetworksTab extends PureComponent { static contextTypes = { - t: PropTypes.func, - metricsEvent: PropTypes.func, + t: PropTypes.func.isRequired, + metricsEvent: PropTypes.func.isRequired, } static propTypes = { - editRpc: PropTypes.func, + editRpc: PropTypes.func.isRequired, rpcUrl: PropTypes.string, chainId: PropTypes.string, ticker: PropTypes.string, viewOnly: PropTypes.bool, networkName: PropTypes.string, - onClear: PropTypes.func, - setRpcTarget: PropTypes.func, + onClear: PropTypes.func.isRequired, + setRpcTarget: PropTypes.func.isRequired, networksTabIsInAddMode: PropTypes.bool, blockExplorerUrl: PropTypes.string, rpcPrefs: PropTypes.object, @@ -145,7 +145,7 @@ export default class NetworksTab extends PureComponent { this.setErrorTo(stateKey, '') } else { const appendedRpc = `http://${url}` - const validWhenAppended = validUrl.isWebUri(appendedRpc) && !url.match(/^https*:\/\/$/) + const validWhenAppended = validUrl.isWebUri(appendedRpc) && !url.match(/^https?:\/\/$/) this.setErrorTo(stateKey, this.context.t(validWhenAppended ? 'uriErrorMsg' : 'invalidRPC')) } diff --git a/ui/app/pages/settings/networks-tab/networks-tab.component.js b/ui/app/pages/settings/networks-tab/networks-tab.component.js index 6ba8dabbe198..2f921a892aaa 100644 --- a/ui/app/pages/settings/networks-tab/networks-tab.component.js +++ b/ui/app/pages/settings/networks-tab/networks-tab.component.js @@ -10,21 +10,21 @@ import NetworkDropdownIcon from '../../../components/app/dropdowns/components/ne export default class NetworksTab extends PureComponent { static contextTypes = { - t: PropTypes.func, - metricsEvent: PropTypes.func, + t: PropTypes.func.isRequired, + metricsEvent: PropTypes.func.isRequired, } static propTypes = { - editRpc: PropTypes.func, - history: PropTypes.object, - location: PropTypes.object, + editRpc: PropTypes.func.isRequired, + history: PropTypes.object.isRequired, + location: PropTypes.object.isRequired, networkIsSelected: PropTypes.bool, networksTabIsInAddMode: PropTypes.bool, - networksToRender: PropTypes.array, + networksToRender: PropTypes.array.isRequired, selectedNetwork: PropTypes.object, - setNetworksTabAddMode: PropTypes.func, - setRpcTarget: PropTypes.func, - setSelectedSettingsRpcUrl: PropTypes.func, + setNetworksTabAddMode: PropTypes.func.isRequired, + setRpcTarget: PropTypes.func.isRequired, + setSelectedSettingsRpcUrl: PropTypes.func.isRequired, providerUrl: PropTypes.string, providerType: PropTypes.string, networkDefaultedToProvider: PropTypes.bool, diff --git a/ui/app/store/actions.js b/ui/app/store/actions.js index 037fa982a5f1..7d45f0932b52 100644 --- a/ui/app/store/actions.js +++ b/ui/app/store/actions.js @@ -1983,13 +1983,13 @@ function updateAndSetCustomRpc (newRpc, chainId, ticker = 'ETH', nickname, rpcPr function editRpc (oldRpc, newRpc, chainId, ticker = 'ETH', nickname, rpcPrefs) { return (dispatch) => { log.debug(`background.delRpcTarget: ${oldRpc}`) - background.delCustomRpc(oldRpc, (err, result) => { + background.delCustomRpc(oldRpc, (err) => { if (err) { log.error(err) return dispatch(self.displayWarning('Had a problem removing network!')) } dispatch(actions.setSelectedToken()) - background.updateAndSetCustomRpc(newRpc, chainId, ticker, nickname || newRpc, rpcPrefs, (err, result) => { + background.updateAndSetCustomRpc(newRpc, chainId, ticker, nickname || newRpc, rpcPrefs, (err) => { if (err) { log.error(err) return dispatch(actions.displayWarning('Had a problem changing networks!'))