From 1e4a867a9a5c398892806f9333473088dd10c2be Mon Sep 17 00:00:00 2001 From: Zeng1998 Date: Sun, 21 May 2023 16:41:04 +0800 Subject: [PATCH] fix: add thumbnail param only for internal link (#1701) * fix: add thumbnail param using `URLSearchParams` * update: add thumnail param only for internal link --- web/src/components/MemoResourceListView.tsx | 7 ++++++- web/src/components/ResourceCover.tsx | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/web/src/components/MemoResourceListView.tsx b/web/src/components/MemoResourceListView.tsx index f2792ec4..06279d76 100644 --- a/web/src/components/MemoResourceListView.tsx +++ b/web/src/components/MemoResourceListView.tsx @@ -46,7 +46,12 @@ const MemoResourceListView: React.FC = (props: Props) => { if (resource.type.startsWith("image")) { return ( - handleImageClick(url)} decoding="async" loading="lazy" /> + handleImageClick(url)} + decoding="async" + loading="lazy" + /> ); } else if (resource.type.startsWith("video")) { diff --git a/web/src/components/ResourceCover.tsx b/web/src/components/ResourceCover.tsx index d102d3fe..d28944d4 100644 --- a/web/src/components/ResourceCover.tsx +++ b/web/src/components/ResourceCover.tsx @@ -44,7 +44,7 @@ const ResourceCover = ({ resource }: ResourceCoverProps) => { showPreviewImageDialog(resourceUrl)} />