Unverified Commit 1e4a867a authored by Zeng1998's avatar Zeng1998 Committed by GitHub

fix: add thumbnail param only for internal link (#1701)

* fix: add thumbnail param using `URLSearchParams`

* update: add thumnail param only for internal link
parent 6bb0b4cd
......@@ -46,7 +46,12 @@ const MemoResourceListView: React.FC<Props> = (props: Props) => {
if (resource.type.startsWith("image")) {
return (
<SquareDiv key={resource.id} className="memo-resource">
<img src={absolutifyLink(url) + "?thumbnail=1"} onClick={() => handleImageClick(url)} decoding="async" loading="lazy" />
<img
src={resource.externalLink ? url : url + "?thumbnail=1"}
onClick={() => handleImageClick(url)}
decoding="async"
loading="lazy"
/>
</SquareDiv>
);
} else if (resource.type.startsWith("video")) {
......
......@@ -44,7 +44,7 @@ const ResourceCover = ({ resource }: ResourceCoverProps) => {
<SquareDiv className="h-20 w-20 flex items-center justify-center overflow-clip">
<img
className="max-w-full max-h-full object-cover shadow"
src={resourceUrl + "?thumbnail=1"}
src={resource.externalLink ? resourceUrl : resourceUrl + "?thumbnail=1"}
onClick={() => showPreviewImageDialog(resourceUrl)}
/>
</SquareDiv>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment