mirror of
https://github.com/usememos/memos.git
synced 2024-12-19 00:51:30 +03: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:
parent
6bb0b4cd47
commit
1e4a867a9a
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user