aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Huang <tmashuang@users.noreply.github.com>2019-04-17 03:39:00 +0800
committerGitHub <noreply@github.com>2019-04-17 03:39:00 +0800
commit00133d31b15d070d55dff13f568cf828dad41424 (patch)
tree2d0a85a31a00f9492e75a3d710209f9d89908325
parent09f2a2a5476c4c119c7294f496f6590156d8d07a (diff)
parent33836c04638bd0ef023ed913e4c8ec976ad3caae (diff)
downloadtangerine-wallet-browser-00133d31b15d070d55dff13f568cf828dad41424.tar
tangerine-wallet-browser-00133d31b15d070d55dff13f568cf828dad41424.tar.gz
tangerine-wallet-browser-00133d31b15d070d55dff13f568cf828dad41424.tar.bz2
tangerine-wallet-browser-00133d31b15d070d55dff13f568cf828dad41424.tar.lz
tangerine-wallet-browser-00133d31b15d070d55dff13f568cf828dad41424.tar.xz
tangerine-wallet-browser-00133d31b15d070d55dff13f568cf828dad41424.tar.zst
tangerine-wallet-browser-00133d31b15d070d55dff13f568cf828dad41424.zip
Merge pull request #6444 from MetaMask/localhost-network-dropdown
Fixes #6321 & #6421 - Add Localhost 8545 for network dropdown names
-rw-r--r--app/_locales/en/messages.json3
-rw-r--r--app/scripts/controllers/network/network.js4
-rw-r--r--ui/app/components/app/dropdowns/network-dropdown.js2
-rw-r--r--ui/app/components/app/loading-network-screen/loading-network-screen.component.js2
-rw-r--r--ui/app/components/app/network.js2
-rw-r--r--ui/app/pages/routes/index.js4
6 files changed, 14 insertions, 3 deletions
diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json
index 154925d1a..f9d23f69e 100644
--- a/app/_locales/en/messages.json
+++ b/app/_locales/en/messages.json
@@ -308,6 +308,9 @@
"connectingToRinkeby": {
"message": "Connecting to Rinkeby Test Network"
},
+ "connectingToLocalhost": {
+ "message": "Connecting to Localhost 8545"
+ },
"connectingToUnknown": {
"message": "Connecting to Unknown Network"
},
diff --git a/app/scripts/controllers/network/network.js b/app/scripts/controllers/network/network.js
index 47432c1e2..ab1198dd3 100644
--- a/app/scripts/controllers/network/network.js
+++ b/app/scripts/controllers/network/network.js
@@ -140,10 +140,10 @@ module.exports = class NetworkController extends EventEmitter {
this.providerConfig = providerConfig
}
- async setProviderType (type) {
+ async setProviderType (type, rpcTarget = '', ticker = 'ETH', nickname = '') {
assert.notEqual(type, 'rpc', `NetworkController - cannot call "setProviderType" with type 'rpc'. use "setRpcTarget"`)
assert(INFURA_PROVIDER_TYPES.includes(type) || type === LOCALHOST, `NetworkController - Unknown rpc type "${type}"`)
- const providerConfig = { type }
+ const providerConfig = { type, rpcTarget, ticker, nickname }
this.providerConfig = providerConfig
}
diff --git a/ui/app/components/app/dropdowns/network-dropdown.js b/ui/app/components/app/dropdowns/network-dropdown.js
index 3d9037a06..7e645725c 100644
--- a/ui/app/components/app/dropdowns/network-dropdown.js
+++ b/ui/app/components/app/dropdowns/network-dropdown.js
@@ -285,6 +285,8 @@ NetworkDropdown.prototype.getNetworkName = function () {
name = this.context.t('kovan')
} else if (providerName === 'rinkeby') {
name = this.context.t('rinkeby')
+ } else if (providerName === 'localhost') {
+ name = this.context.t('localhost')
} else {
name = provider.nickname || this.context.t('unknownNetwork')
}
diff --git a/ui/app/components/app/loading-network-screen/loading-network-screen.component.js b/ui/app/components/app/loading-network-screen/loading-network-screen.component.js
index 348a997c8..b79051d0b 100644
--- a/ui/app/components/app/loading-network-screen/loading-network-screen.component.js
+++ b/ui/app/components/app/loading-network-screen/loading-network-screen.component.js
@@ -45,6 +45,8 @@ export default class LoadingNetworkScreen extends PureComponent {
name = this.context.t('connectingToKovan')
} else if (providerName === 'rinkeby') {
name = this.context.t('connectingToRinkeby')
+ } else if (providerName === 'localhost') {
+ name = this.context.t('connectingToLocalhost')
} else {
name = this.context.t('connectingTo', [providerId])
}
diff --git a/ui/app/components/app/network.js b/ui/app/components/app/network.js
index e18404f42..54065dd73 100644
--- a/ui/app/components/app/network.js
+++ b/ui/app/components/app/network.js
@@ -139,7 +139,7 @@ Network.prototype.render = function () {
},
}),
- h('.network-name', providerNick || context.t('privateNetwork')),
+ h('.network-name', providerName === 'localhost' ? context.t('localhost') : providerNick || context.t('privateNetwork')),
h('i.fa.fa-chevron-down.fa-lg.network-caret'),
])
}
diff --git a/ui/app/pages/routes/index.js b/ui/app/pages/routes/index.js
index e06d88c90..37ff2df61 100644
--- a/ui/app/pages/routes/index.js
+++ b/ui/app/pages/routes/index.js
@@ -267,6 +267,8 @@ class Routes extends Component {
name = this.context.t('connectingToKovan')
} else if (providerName === 'rinkeby') {
name = this.context.t('connectingToRinkeby')
+ } else if (providerName === 'localhost') {
+ name = this.context.t('connectingToLocalhost')
} else {
name = this.context.t('connectingTo', [providerId])
}
@@ -288,6 +290,8 @@ class Routes extends Component {
name = this.context.t('kovan')
} else if (providerName === 'rinkeby') {
name = this.context.t('rinkeby')
+ } else if (providerName === 'localhost') {
+ name = this.context.t('localhost')
} else {
name = this.context.t('unknownNetwork')
}