From e8ac1e6d90ac66718639738b78cc4a168ff65770 Mon Sep 17 00:00:00 2001 From: Rob Upchurch Date: Sat, 9 Mar 2024 22:31:47 -0500 Subject: [PATCH] Remove unused useEffect hook and disable button after copying --- src/FetchData.jsx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/FetchData.jsx b/src/FetchData.jsx index 4f1c18f..744512f 100644 --- a/src/FetchData.jsx +++ b/src/FetchData.jsx @@ -1,4 +1,4 @@ -import { useEffect, useState } from 'react'; +import { useState } from 'react'; import axios from 'axios'; import Papa from 'papaparse'; import { saveAs } from 'file-saver'; @@ -64,10 +64,6 @@ function FetchData() { const [fileChanged, setFileChanged] = useState(true); const [copied, setCopied] = useState(null); - useEffect(() => { - console.log(missingIds); - }, [missingIds]); - const handleFileUpload = (event) => { const file = event.target.files[0]; setFile(file); @@ -391,7 +387,8 @@ function FetchData() { navigator.clipboard.writeText(missingIdsText); setCopied(true); }} - className='my-4 p-2 bg-yellow rounded-md relative'> + className='my-4 p-2 bg-yellow rounded-md relative' + disabled={copied}> {copied ? 'Copied!' : 'Copy Missing IDs'}