add value for comment.thumbnailUrl in embed

This commit is contained in:
Tom
2023-04-30 16:23:32 +02:00
parent a9de38a3be
commit d15dacb06f
3 changed files with 10 additions and 9 deletions
+4 -4
View File
@@ -489,7 +489,7 @@ const Board = () => {
<span key={`fta-${index}`} className="file-thumb">
{thread.thumbnailUrl ? (
<img key={`fti-${index}`}
src={thread.thumbnailUrl} alt={commentMediaInfo.type}
src={commentMediaInfo.thumbnail} alt={commentMediaInfo.type}
onClick={handleImageClick}
style={{cursor: "pointer"}}
onError={(e) => e.target.src = fallbackImgUrl} />
@@ -725,7 +725,7 @@ const Board = () => {
<span key={`fta-${index}`} className="file-thumb-reply">
{reply.thumbnailUrl ? (
<img key={`fti-${index}`}
src={reply.thumbnailUrl} alt={replyMediaInfo.type}
src={replyMediaInfo.thumbnail} alt={replyMediaInfo.type}
onClick={handleImageClick}
style={{cursor: "pointer"}}
onError={(e) => e.target.src = fallbackImgUrl} />
@@ -860,7 +860,7 @@ const Board = () => {
<span key={`mob-ft${thread.cid}`} className="file-thumb-mobile">
{thread.thumbnailUrl ? (
<img key={`mob-img-${index}`}
src={thread.thumbnailUrl} alt="thumbnail"
src={commentMediaInfo.thumbnail} alt="thumbnail"
onClick={handleImageClick}
style={{cursor: "pointer"}}
onError={(e) => e.target.src = fallbackImgUrl} />
@@ -1002,7 +1002,7 @@ const Board = () => {
<span key={`mob-ft${reply.cid}`} className="file-thumb-mobile">
{reply.thumbnailUrl ? (
<img key={`mob-img-${index}`}
src={reply.thumbnailUrl} alt="thumbnail"
src={replyMediaInfo.thumbnail} alt="thumbnail"
onClick={handleImageClick}
style={{cursor: "pointer"}}
onError={(e) => e.target.src = fallbackImgUrl} />
+4 -4
View File
@@ -469,7 +469,7 @@ const Thread = () => {
<span key={`fta-${comment.cid}`} className="file-thumb">
{comment.thumbnailUrl ? (
<img key={`fti-${comment.cid}`}
src={comment.thumbnailUrl} alt={commentMediaInfo.type}
src={commentMediaInfo.thumbnail} alt={commentMediaInfo.type}
onClick={handleImageClick}
style={{cursor: "pointer"}}
onError={(e) => e.target.src = fallbackImgUrl} />
@@ -671,7 +671,7 @@ const Thread = () => {
<span key={`fta-${index}`} className="file-thumb-reply">
{reply.thumbnailUrl ? (
<img key={`fti-${index}`}
src={reply.thumbnailUrl} alt="thumbnail"
src={replyMediaInfo.thumbnail} alt="thumbnail"
onClick={handleImageClick}
style={{cursor: "pointer"}}
onError={(e) => e.target.src = fallbackImgUrl} />
@@ -785,7 +785,7 @@ const Thread = () => {
<span key={`mob-ft${comment.cid}`} className="file-thumb-mobile">
{comment.thumbnailUrl ? (
<img key={`mob-img-${comment.cid}`}
src={comment.thumbnailUrl} alt={commentMediaInfo.type}
src={commentMediaInfo.thumbnail} alt={commentMediaInfo.type}
onClick={handleImageClick}
style={{cursor: "pointer"}}
onError={(e) => e.target.src = fallbackImgUrl} />
@@ -905,7 +905,7 @@ const Thread = () => {
<span key={`mob-ft${reply.cid}`} className="file-thumb-mobile">
{reply.thumbnailUrl ? (
<img key={`mob-img-${reply.cid}`}
src={reply.thumbnailUrl} alt={replyMediaInfo.type}
src={replyMediaInfo.thumbnail} alt={replyMediaInfo.type}
onClick={handleImageClick}
style={{cursor: "pointer"}}
onError={(e) => e.target.src = fallbackImgUrl} />
+2 -1
View File
@@ -39,8 +39,9 @@ const getCommentMediaInfo = (comment) => {
if (comment?.thumbnailUrl && comment?.thumbnailUrl !== comment?.link) {
return {
url: comment.thumbnailUrl,
url: comment.link,
type: 'webpage',
thumbnail: comment.thumbnailUrl,
};
}