mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix(home): remove fallback image warning
This commit is contained in:
@@ -18,7 +18,6 @@ const RecentThread = ({ commentCid }) => {
|
|||||||
const subplebbit = useSubplebbit({ subplebbitAddress: comment?.subplebbitAddress });
|
const subplebbit = useSubplebbit({ subplebbitAddress: comment?.subplebbitAddress });
|
||||||
const { setSelectedAddress, setSelectedTitle } = useGeneralStore((state) => state);
|
const { setSelectedAddress, setSelectedTitle } = useGeneralStore((state) => state);
|
||||||
const commentMediaInfo = getCommentMediaInfo(comment);
|
const commentMediaInfo = getCommentMediaInfo(comment);
|
||||||
const fallbackImgUrl = 'assets/filedeleted-res.gif';
|
|
||||||
const isMediaShowed =
|
const isMediaShowed =
|
||||||
comment.link &&
|
comment.link &&
|
||||||
commentMediaInfo &&
|
commentMediaInfo &&
|
||||||
@@ -51,14 +50,7 @@ const RecentThread = ({ commentCid }) => {
|
|||||||
) : commentMediaInfo?.type === 'image' ? (
|
) : commentMediaInfo?.type === 'image' ? (
|
||||||
<img className='board-avatar' src={commentMediaInfo?.url} alt='post' />
|
<img className='board-avatar' src={commentMediaInfo?.url} alt='post' />
|
||||||
) : commentMediaInfo?.type === 'video' ? (
|
) : commentMediaInfo?.type === 'video' ? (
|
||||||
<video
|
<video className='board-avatar' src={commentMediaInfo?.url} alt='post' />
|
||||||
className='board-avatar'
|
|
||||||
src={commentMediaInfo?.url}
|
|
||||||
onError={(e) => {
|
|
||||||
e.target.src = fallbackImgUrl;
|
|
||||||
}}
|
|
||||||
alt='post'
|
|
||||||
/>
|
|
||||||
) : commentMediaInfo?.type === 'iframe' ? (
|
) : commentMediaInfo?.type === 'iframe' ? (
|
||||||
<img className='board-avatar' src={commentMediaInfo?.thumbnail} alt='post' />
|
<img className='board-avatar' src={commentMediaInfo?.thumbnail} alt='post' />
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
Reference in New Issue
Block a user