fix: verify page robohash
This commit is contained in:
parent
3d958e809f
commit
5e114f7fb8
@ -17,6 +17,7 @@ import { MetadataController } from '../../controllers'
|
|||||||
import { getProfileRoute } from '../../routes'
|
import { getProfileRoute } from '../../routes'
|
||||||
import { Meta, ProfileMetadata } from '../../types'
|
import { Meta, ProfileMetadata } from '../../types'
|
||||||
import {
|
import {
|
||||||
|
getRoboHashPicture,
|
||||||
hexToNpub,
|
hexToNpub,
|
||||||
parseJson,
|
parseJson,
|
||||||
readContentOfZipEntry,
|
readContentOfZipEntry,
|
||||||
@ -112,8 +113,9 @@ export const VerifyPage = () => {
|
|||||||
setIsLoading(false)
|
setIsLoading(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
const imageLoadError = (event: any) => {
|
const imageLoadError = (event: any, pubkey: string) => {
|
||||||
event.target.src = placeholderAvatar
|
const npub = hexToNpub(pubkey)
|
||||||
|
event.target.src = npub
|
||||||
}
|
}
|
||||||
|
|
||||||
const getRoboImageUrl = (pubkey: string) => {
|
const getRoboImageUrl = (pubkey: string) => {
|
||||||
@ -143,7 +145,7 @@ export const VerifyPage = () => {
|
|||||||
return (
|
return (
|
||||||
<Box className={styles.user}>
|
<Box className={styles.user}>
|
||||||
<img
|
<img
|
||||||
onError={imageLoadError}
|
onError={(event) => {imageLoadError(event, pubkey)}}
|
||||||
src={profile?.picture || getRoboImageUrl(pubkey)}
|
src={profile?.picture || getRoboImageUrl(pubkey)}
|
||||||
alt="Profile Image"
|
alt="Profile Image"
|
||||||
className="profile-image"
|
className="profile-image"
|
||||||
|
Loading…
Reference in New Issue
Block a user