From 16d68925a4021d607ec690d96609e21e659bd27a Mon Sep 17 00:00:00 2001 From: Alex Demchenko Date: Thu, 27 Jan 2022 21:56:43 +0100 Subject: [PATCH] Fixes after PR --- src/LinkPreview.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/LinkPreview.tsx b/src/LinkPreview.tsx index 094318d..098b2ae 100644 --- a/src/LinkPreview.tsx +++ b/src/LinkPreview.tsx @@ -68,7 +68,11 @@ export const LinkPreview = React.memo( React.useEffect(() => { let isCancelled = false - if (previewData) return setData(previewData) + if (previewData) { + setData(previewData) + return + } + const fetchData = async () => { setData(undefined) const newData = await getPreviewData(text)