updated docs, small improvement of recent RPC rendering

feature/default_network_editable
Evgeniy Filatov 6 years ago
parent c0b5e8a088
commit 9a80d6e859
  1. 2
      app/scripts/controllers/preferences.js
  2. 3
      old-ui/app/components/app-bar.js
  3. 5
      ui/app/components/dropdowns/network-dropdown.js

@ -322,7 +322,7 @@ class PreferencesController {
/**
* Returns an updated rpcList based on the passed url and the current list.
* The returned list will have a max length of 2. If the _url currently exists it the list, it will be moved to the
* The returned list will have a max length of 3. If the _url currently exists it the list, it will be moved to the
* end of the list. The current list is modified and returned as a promise.
*
* @param {string} _url The rpc url to add to the frequentRpcList.

@ -352,8 +352,9 @@ module.exports = class AppBar extends Component {
renderCommonRpc (rpcList, provider) {
const {dispatch} = this.props
const reversedRpcList = rpcList.slice().reverse()
return rpcList.map((rpc) => {
return reversedRpcList.map((rpc) => {
const currentRpcTarget = provider.type === 'rpc' && rpc === provider.rpcTarget
if ((rpc === LOCALHOST_RPC_URL) || currentRpcTarget) {

@ -272,8 +272,9 @@ NetworkDropdown.prototype.getNetworkName = function () {
NetworkDropdown.prototype.renderCommonRpc = function (rpcList, provider) {
const props = this.props
const reversedRpcList = rpcList.slice().reverse()
return rpcList.map((rpc) => {
return reversedRpcList.map((rpc) => {
const currentRpcTarget = provider.type === 'rpc' && rpc === provider.rpcTarget
if ((rpc === 'http://localhost:8545') || currentRpcTarget) {
@ -302,7 +303,7 @@ NetworkDropdown.prototype.renderCommonRpc = function (rpcList, provider) {
]
)
}
}).reverse()
})
}
NetworkDropdown.prototype.renderCustomOption = function (provider) {

Loading…
Cancel
Save