Skip to content
Permalink
Browse files

fix(launchpad): fallback wallet name incase host unknown

  • Loading branch information...
mrfelton committed Apr 10, 2019
1 parent 4b706d9 commit 522fc83d68ffde71dc742a069b3bc6f72c0e0d97
Showing with 10 additions and 3 deletions.
  1. +10 −3 renderer/components/Util/WalletName.js
@@ -4,11 +4,18 @@ const WalletName = ({ wallet }) => {
if (!wallet) {
return null
}
const { name, host, type, id } = wallet

if (wallet.type === 'local') {
return wallet.name || `Wallet #${wallet.id}`
// For local wallets, display the wallet name if set.
// Otherwise fallback to the wallet id.
if (type === 'local') {
return name || `Wallet #${id}`
}
return wallet.name || wallet.host.split(':')[0]

// For remote wallets, use the wallet name if set.
// Otherwise use the hostname.
// If neither are set, provide a fallback value.
return name || (host && host.split(':')[0]) || '[unnamed]'
}

WalletName.propTypes = {

0 comments on commit 522fc83

Please sign in to comment.
You can’t perform that action at this time.