diff --git a/ui/app/components/app/connected-sites-list/connected-sites-list.component.js b/ui/app/components/app/connected-sites-list/connected-sites-list.component.js
index 1bde4855f7ba..9890a4515359 100644
--- a/ui/app/components/app/connected-sites-list/connected-sites-list.component.js
+++ b/ui/app/components/app/connected-sites-list/connected-sites-list.component.js
@@ -89,7 +89,7 @@ export default class ConnectedSitesList extends Component {
}
{domainIsExpanded
?
- { domain.extensionId ? t('extensionId', [domain.extensionId]) : domain.key }
+ { domain.extensionId ? t('extensionId', [domain.extensionId]) : domain.secondaryName }
: null
}
diff --git a/ui/app/selectors/selectors.js b/ui/app/selectors/selectors.js
index 206d27a62cb4..c29dcb35f27d 100644
--- a/ui/app/selectors/selectors.js
+++ b/ui/app/selectors/selectors.js
@@ -459,15 +459,16 @@ function getAddressConnectedDomainMap (state) {
if (domains) {
Object.keys(domains).forEach(domainKey => {
const { permissions } = domains[domainKey]
- const { icon, name } = domainMetadata[domainKey]
+ const { icon, name } = domainMetadata[domainKey] || {}
permissions.forEach(perm => {
const caveats = perm.caveats || []
const exposedAccountCaveat = caveats.find(caveat => caveat.name === 'exposedAccounts')
if (exposedAccountCaveat && exposedAccountCaveat.value && exposedAccountCaveat.value.length) {
exposedAccountCaveat.value.forEach(address => {
+ const nameToRender = name || domainKey
addressConnectedIconMap[address] = addressConnectedIconMap[address]
- ? { ...addressConnectedIconMap[address], [domainKey]: { icon, name } }
- : { [domainKey]: { icon, name } }
+ ? { ...addressConnectedIconMap[address], [domainKey]: { icon, name: nameToRender } }
+ : { [domainKey]: { icon, name: nameToRender } }
})
}
})
@@ -531,7 +532,7 @@ function getRenderablePermissionsDomains (state) {
name,
icon,
extensionId,
- } = domainMetadata[domainKey]
+ } = domainMetadata[domainKey] || {}
const permissionsHistoryForDomain = permissionsHistory[domainKey] || {}
const ethAccountsPermissionsForDomain = permissionsHistoryForDomain['eth_accounts'] || {}
const accountsLastConnectedTime = ethAccountsPermissionsForDomain.accounts || {}
@@ -542,7 +543,8 @@ function getRenderablePermissionsDomains (state) {
: ''
return [ ...acc, {
- name,
+ name: name || domainKey,
+ secondaryName: name ? domainKey : '',
icon,
key: domainKey,
lastConnectedTime,