diff --git a/src/frontend/src/components/DroneOperatorTask/DescriptionSection/DescriptionBox/index.tsx b/src/frontend/src/components/DroneOperatorTask/DescriptionSection/DescriptionBox/index.tsx index 9f447a42..542a07ee 100644 --- a/src/frontend/src/components/DroneOperatorTask/DescriptionSection/DescriptionBox/index.tsx +++ b/src/frontend/src/components/DroneOperatorTask/DescriptionSection/DescriptionBox/index.tsx @@ -1,4 +1,4 @@ -import { useState } from 'react'; +import { useEffect, useState } from 'react'; import { useParams } from 'react-router-dom'; import { useDispatch } from 'react-redux'; import { toast } from 'react-toastify'; @@ -14,6 +14,7 @@ import { Button } from '@Components/RadixComponents/Button'; import { Label } from '@Components/common/FormUI'; import SwitchTab from '@Components/common/SwitchTab'; import { + resetFilesExifData, setSelectedTaskDetailToViewOrthophoto, setUploadedImagesType, } from '@Store/actions/droneOperatorTask'; @@ -67,6 +68,10 @@ const DescriptionBox = () => { }, }); + useEffect(() => { + dispatch(resetFilesExifData()); + }, [dispatch]); + const { mutate: reStartImageryProcess, isLoading: imageProcessingStarting } = useMutation({ mutationFn: () => diff --git a/src/frontend/src/components/DroneOperatorTask/DescriptionSection/UploadsBox/index.tsx b/src/frontend/src/components/DroneOperatorTask/DescriptionSection/UploadsBox/index.tsx index cb8e0327..75bf7da7 100644 --- a/src/frontend/src/components/DroneOperatorTask/DescriptionSection/UploadsBox/index.tsx +++ b/src/frontend/src/components/DroneOperatorTask/DescriptionSection/UploadsBox/index.tsx @@ -1,7 +1,7 @@ /* eslint-disable no-await-in-loop */ import { Button } from '@Components/RadixComponents/Button'; import { toggleModal } from '@Store/actions/common'; -import { setFiles, setFilesExifData } from '@Store/actions/droneOperatorTask'; +import { setFilesExifData } from '@Store/actions/droneOperatorTask'; import { useTypedDispatch, useTypedSelector } from '@Store/hooks'; import getExifData from '@Utils/getExifData'; import { toast } from 'react-toastify'; @@ -12,7 +12,9 @@ const UploadsBox = ({ label?: string; }) => { const dispatch = useTypedDispatch(); - const files = useTypedSelector(state => state.droneOperatorTask.files); + const files = useTypedSelector( + state => state.droneOperatorTask.filesExifData, + ); const handleFileChange = async ( event: React.ChangeEvent, ) => { @@ -20,7 +22,6 @@ const UploadsBox = ({ const selectedFiles = event.target.files; if (!selectedFiles || selectedFiles?.length === 0) return; const selectedFilesArray: File[] = Array.from(selectedFiles); - dispatch(setFiles(selectedFilesArray)); try { const exifData = await Promise.all( selectedFilesArray.map(async (file: File) => {