mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Fix site icon fallback letter (#8815)
The letter chosen for the fallback site icon was being set inconsistently throughout the extension. The connect flow was using the first letter of the `origin` for the letter (which was always `H`, because `HTTP`), but the connect sites list and the account menu were using the `name` from the domain metadata. The `name` is now used for the fallback icon everywhere. A selector that supplied a default domain metadata object has also been augmented to use the `hostname` rather than the `origin` as a fallback name, to match the behavior of the inpage provider.
This commit is contained in:
parent
a6ee23cf9a
commit
ec10323495
@ -133,7 +133,7 @@ export default class PermissionPageContainerContent extends PureComponent {
|
|||||||
<div className="permission-approval-container__content-container">
|
<div className="permission-approval-container__content-container">
|
||||||
<PermissionsConnectHeader
|
<PermissionsConnectHeader
|
||||||
icon={domainMetadata.icon}
|
icon={domainMetadata.icon}
|
||||||
iconName={domainMetadata.origin}
|
iconName={domainMetadata.name}
|
||||||
headerTitle={title}
|
headerTitle={title}
|
||||||
headerText={ domainMetadata.extensionId
|
headerText={ domainMetadata.extensionId
|
||||||
? t('allowExternalExtensionTo', [domainMetadata.extensionId])
|
? t('allowExternalExtensionTo', [domainMetadata.extensionId])
|
||||||
|
@ -191,7 +191,7 @@ export default class ChooseAccount extends Component {
|
|||||||
<div className="permissions-connect-choose-account">
|
<div className="permissions-connect-choose-account">
|
||||||
<PermissionsConnectHeader
|
<PermissionsConnectHeader
|
||||||
icon={targetDomainMetadata.icon}
|
icon={targetDomainMetadata.icon}
|
||||||
iconName={targetDomainMetadata.origin}
|
iconName={targetDomainMetadata.name}
|
||||||
headerTitle={t('connectWithMetaMask')}
|
headerTitle={t('connectWithMetaMask')}
|
||||||
headerText={accounts.length > 0
|
headerText={accounts.length > 0
|
||||||
? t('selectAccounts')
|
? t('selectAccounts')
|
||||||
|
@ -292,7 +292,8 @@ export function getTargetDomainMetadata (state, request, defaultOrigin) {
|
|||||||
|
|
||||||
const { metadata: requestMetadata = {} } = request || {}
|
const { metadata: requestMetadata = {} } = request || {}
|
||||||
const origin = requestMetadata.origin || defaultOrigin
|
const origin = requestMetadata.origin || defaultOrigin
|
||||||
const targetDomainMetadata = (domainMetadata[origin] || { name: origin, icon: null })
|
const hostname = (new URL(origin).hostname)
|
||||||
|
const targetDomainMetadata = (domainMetadata[origin] || { name: hostname, icon: null })
|
||||||
targetDomainMetadata.origin = origin
|
targetDomainMetadata.origin = origin
|
||||||
|
|
||||||
return targetDomainMetadata
|
return targetDomainMetadata
|
||||||
|
Loading…
Reference in New Issue
Block a user