mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
fix: add thumbnail param only for internal link (#1701)
* fix: add thumbnail param using `URLSearchParams` * update: add thumnail param only for internal link
This commit is contained in:
@ -46,7 +46,12 @@ const MemoResourceListView: React.FC<Props> = (props: Props) => {
|
|||||||
if (resource.type.startsWith("image")) {
|
if (resource.type.startsWith("image")) {
|
||||||
return (
|
return (
|
||||||
<SquareDiv key={resource.id} className="memo-resource">
|
<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>
|
</SquareDiv>
|
||||||
);
|
);
|
||||||
} else if (resource.type.startsWith("video")) {
|
} 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">
|
<SquareDiv className="h-20 w-20 flex items-center justify-center overflow-clip">
|
||||||
<img
|
<img
|
||||||
className="max-w-full max-h-full object-cover shadow"
|
className="max-w-full max-h-full object-cover shadow"
|
||||||
src={resourceUrl + "?thumbnail=1"}
|
src={resource.externalLink ? resourceUrl : resourceUrl + "?thumbnail=1"}
|
||||||
onClick={() => showPreviewImageDialog(resourceUrl)}
|
onClick={() => showPreviewImageDialog(resourceUrl)}
|
||||||
/>
|
/>
|
||||||
</SquareDiv>
|
</SquareDiv>
|
||||||
|
Reference in New Issue
Block a user