File tree Expand file tree Collapse file tree
entries/contentScript/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ /**
2+ * @param e
3+ * @param className string[]
4+ */
5+ export default function imageOnError ( e , className = [ ] ) {
6+ e . target . onError = null ;
7+ e . target . classList . add ( 'text-transparent' , ...className ) ;
8+ }
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import { hasSubscriptionFeature } from '~/entries/contentScript/hooks/useSubscri
1212import { subscriptionIds , subscriptionFeatures } from '~/enums' ;
1313import PremiumCtaLabel from '~/entries/contentScript/components/PremiumCtaLabel' ;
1414import { buildReactionFromUrl } from '~/common/pretty' ;
15+ import imageOnError from '~/common/imageOnError' ;
1516
1617function ReactionPreview ( { reaction } ) {
1718 const { t } = useTranslation ( ) ;
@@ -34,6 +35,7 @@ function ReactionPreview({ reaction }) {
3435 < img
3536 src = { reaction . from_info . avatar_url }
3637 className = "inline size-7 overflow-hidden rounded-full"
38+ onError = { ( e ) => imageOnError ( e , [ 'bg-primary-gradient-hc-from/40' ] ) }
3739 alt = { reaction . from_info . name }
3840 />
3941 </ a >
You can’t perform that action at this time.
0 commit comments