From a9bb05c4da2c60735f7644580ddd4d5fa666ab89 Mon Sep 17 00:00:00 2001 From: pierrbt Date: Fri, 23 Jun 2023 00:05:53 +0200 Subject: [PATCH] Last updated --- .../modals/showCompletedUploadModal.tsx | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/frontend/src/components/upload/modals/showCompletedUploadModal.tsx b/frontend/src/components/upload/modals/showCompletedUploadModal.tsx index 9283191..bb2b9f5 100644 --- a/frontend/src/components/upload/modals/showCompletedUploadModal.tsx +++ b/frontend/src/components/upload/modals/showCompletedUploadModal.tsx @@ -29,24 +29,21 @@ const Body = ({ share, appUrl }: { share: Share; appUrl: string }) => { const clipboard = useClipboard({ timeout: 500 }); const modals = useModals(); const router = useRouter(); + const [checkState, setCheckState] = useState(false); const timerRef = useRef | undefined>(undefined); const link = `${appUrl}/share/${share.id}`; const copyLink = () => { - clipboard.copy(link); - toast.success("Your link was copied to the keyboard."); - - if (timerRef.current) { - clearTimeout(timerRef.current); - } - - timerRef.current = setTimeout(() => { - setCheckState(false); - }, 1500); - - setCheckState(true); + clipboard.copy(link); + toast.success("Your link was copied to the keyboard."); + if (timerRef.current) + clearTimeout(timerRef.current); + timerRef.current = setTimeout(() => { + setCheckState(false); + }, 1500); + setCheckState(true); } return ( @@ -54,7 +51,6 @@ const Body = ({ share, appUrl }: { share: Share; appUrl: string }) => {