Skip to content

Commit

Permalink
fix: fix issue with inability to copy
Browse files Browse the repository at this point in the history
  • Loading branch information
rockbenben committed Apr 21, 2023
1 parent 826e393 commit 9501db9
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/pages/_components/ShowcaseCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 9501db9

Please sign in to comment.