diff --git a/src/js/components/Identicon.tsx b/src/js/components/Identicon.tsx index 8cb81c10..0d2d6ec7 100644 --- a/src/js/components/Identicon.tsx +++ b/src/js/components/Identicon.tsx @@ -21,6 +21,7 @@ type State = { name: string | null; activity: string | null; identicon: string | null; + hasError: boolean; }; const IdenticonContainer = styled.div` @@ -85,12 +86,19 @@ class MyIdenticon extends Component { ['online', 'active'].indexOf(this.state.activity ?? '') > -1 ? this.state.activity : ''; const hasPicture = this.state.picture && + !this.state.hasError && !this.props.hidePicture && !Nostr.blockedUsers.has(this.props.str as string); const hasPictureStyle = hasPicture ? 'has-picture' : ''; const showTooltip = this.props.showTooltip ? 'tooltip' : ''; - const pictureElement = ; + const pictureElement = ( + this.setState({ hasError: true })} + /> + ); return ( void; }; // need to have trailing slash, otherwise you could do https://imgur.com.myevilwebsite.com/image.png