From 59deed40096dab150938518ac19886c1b27b0401 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Wed, 21 Jun 2023 13:42:52 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8=20refactor(inputFileComponent):=20?= =?UTF-8?q?remove=20unused=20flows=20and=20tabIndex=20variables,=20use=20t?= =?UTF-8?q?abId=20instead=20The=20flows=20and=20tabIndex=20variables=20wer?= =?UTF-8?q?e=20not=20being=20used=20in=20the=20component,=20so=20they=20we?= =?UTF-8?q?re=20removed.=20The=20tabId=20variable=20from=20the=20TabsConte?= =?UTF-8?q?xt=20is=20now=20being=20used=20instead=20to=20upload=20the=20fi?= =?UTF-8?q?le=20to=20the=20correct=20tab.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/frontend/src/components/inputFileComponent/index.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/frontend/src/components/inputFileComponent/index.tsx b/src/frontend/src/components/inputFileComponent/index.tsx index efbc53b61..041c2e01b 100644 --- a/src/frontend/src/components/inputFileComponent/index.tsx +++ b/src/frontend/src/components/inputFileComponent/index.tsx @@ -17,8 +17,7 @@ export default function InputFileComponent({ }: FileComponentType) { const [myValue, setMyValue] = useState(value); const { setErrorData } = useContext(alertContext); - const { flows, tabIndex } = useContext(TabsContext); - const { id } = flows[tabIndex]; + const { tabId } = useContext(TabsContext); useEffect(() => { if (disabled) { setMyValue(""); @@ -55,7 +54,7 @@ export default function InputFileComponent({ // Check if the file type is correct if (file && checkFileType(file.name)) { // Upload the file - uploadFile(file, id) + uploadFile(file, tabId) .then((res) => res.data) .then((data) => { console.log("File uploaded successfully");