From 9501db92963e82d80584feb3baf0214d74cd97ff Mon Sep 17 00:00:00 2001 From: rockbenben Date: Fri, 21 Apr 2023 12:14:53 +0800 Subject: [PATCH] fix: fix issue with inability to copy --- src/pages/_components/ShowcaseCard/index.tsx | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/pages/_components/ShowcaseCard/index.tsx b/src/pages/_components/ShowcaseCard/index.tsx index 4243736ec..1fc5badc1 100644 --- a/src/pages/_components/ShowcaseCard/index.tsx +++ b/src/pages/_components/ShowcaseCard/index.tsx @@ -87,15 +87,13 @@ function ShowcaseCard({ user, isDescription, copyCount, onCopy }) { const handleCopyClick = useCallback(async () => { try { const updatedCount = await updateCopyCount(user.id); - if (updatedCount !== null) { - if (user.description) { - copy(user.description); - } - setShowCopied(true); - setTimeout(() => setShowCopied(false), 2000); - // Notify parent component to update the copy count - onCopy(user.id, updatedCount); + if (user.description) { + copy(user.description); } + setShowCopied(true); + setTimeout(() => setShowCopied(false), 2000); + // Notify parent component to update the copy count + onCopy(user.id, updatedCount); } catch (error) { console.error("Error updating copy count:", error); }