mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Fix UI crash when domain metadata is missing (#10180)
The "Confirm public encryption key" page will now no longer crash when the domain metadata is missing.
This commit is contained in:
parent
0dfdd44ae7
commit
9e03066157
@ -158,23 +158,24 @@ export default class ConfirmEncryptionPublicKey extends Component {
|
|||||||
const { domainMetadata, txData } = this.props
|
const { domainMetadata, txData } = this.props
|
||||||
const { t } = this.context
|
const { t } = this.context
|
||||||
|
|
||||||
const origin = domainMetadata[txData.origin]
|
const originMetadata = domainMetadata[txData.origin]
|
||||||
const notice = t('encryptionPublicKeyNotice', [origin.name])
|
const notice = t('encryptionPublicKeyNotice', [txData.origin])
|
||||||
|
const name = originMetadata?.name || txData.origin
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="request-encryption-public-key__body">
|
<div className="request-encryption-public-key__body">
|
||||||
{this.renderAccountInfo()}
|
{this.renderAccountInfo()}
|
||||||
<div className="request-encryption-public-key__visual">
|
<div className="request-encryption-public-key__visual">
|
||||||
<section>
|
<section>
|
||||||
{origin.icon ? (
|
{originMetadata?.icon ? (
|
||||||
<img
|
<img
|
||||||
className="request-encryption-public-key__visual-identicon"
|
className="request-encryption-public-key__visual-identicon"
|
||||||
src={origin.icon}
|
src={originMetadata.icon}
|
||||||
alt=""
|
alt=""
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<i className="request-encryption-public-key__visual-identicon--default">
|
<i className="request-encryption-public-key__visual-identicon--default">
|
||||||
{origin.name.charAt(0).toUpperCase()}
|
{name.charAt(0).toUpperCase()}
|
||||||
</i>
|
</i>
|
||||||
)}
|
)}
|
||||||
<div className="request-encryption-public-key__notice">
|
<div className="request-encryption-public-key__notice">
|
||||||
|
Loading…
Reference in New Issue
Block a user