🔨 refactor(inputFileComponent): remove unused flows and tabIndex variables, use tabId instead
The flows and tabIndex variables were not being used in the component, so they were removed. The tabId variable from the TabsContext is now being used instead to upload the file to the correct tab.
This commit is contained in:
parent
a42b6587c5
commit
59deed4009
1 changed files with 2 additions and 3 deletions
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue