Skip to content

Commit

Permalink
Remove unused useEffect hook and disable button after copying
Browse files Browse the repository at this point in the history
  • Loading branch information
Kerakis committed Mar 10, 2024
1 parent a7967d6 commit e8ac1e6
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/FetchData.jsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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'}
</button>
</>
Expand Down

0 comments on commit e8ac1e6

Please sign in to comment.