Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #6321 & #6421 - Add Localhost 8545 for network dropdown names #6444

Merged
merged 2 commits into from
Apr 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions app/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,9 @@
"connectingToRinkeby": {
"message": "Connecting to Rinkeby Test Network"
},
"connectingToLocalhost": {
"message": "Connecting to Localhost 8545"
},
"connectingToUnknown": {
"message": "Connecting to Unknown Network"
},
Expand Down
4 changes: 2 additions & 2 deletions app/scripts/controllers/network/network.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
2 changes: 2 additions & 0 deletions ui/app/components/app/dropdowns/network-dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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])
}
Expand Down
2 changes: 1 addition & 1 deletion ui/app/components/app/network.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
])
}
Expand Down
4 changes: 4 additions & 0 deletions ui/app/pages/routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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])
}
Expand All @@ -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')
}
Expand Down