Skip to content

Commit

Permalink
feat(task-description): all the variables related to take-off point u…
Browse files Browse the repository at this point in the history
…pdation reset to initial state on component unmount
  • Loading branch information
Sujit committed Sep 25, 2024
1 parent 2b45720 commit b330474
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ import { GeojsonType } from '@Components/common/MapLibreComponents/types';
import { Button } from '@Components/RadixComponents/Button';
import { postTaskWaypoint } from '@Services/tasks';
import { toggleModal } from '@Store/actions/common';
import { setSelectedTakeOffPoint } from '@Store/actions/droneOperatorTask';
import {
setSelectedTakeOffPoint,
setSelectedTakeOffPointOption,
} from '@Store/actions/droneOperatorTask';
import { useTypedSelector } from '@Store/hooks';
import { useMutation, useQueryClient } from '@tanstack/react-query';
import getBbox from '@turf/bbox';
Expand Down Expand Up @@ -81,6 +84,7 @@ const MapSection = ({ className }: { className?: string }) => {
return data;
});
dispatch(setSelectedTakeOffPoint(null));
dispatch(setSelectedTakeOffPointOption('current_location'));
},
onError: (err: any) => {
toast.error(err?.response?.data?.detail || err.message);
Expand Down Expand Up @@ -158,6 +162,7 @@ const MapSection = ({ className }: { className?: string }) => {
useEffect(
() => () => {
dispatch(setSelectedTakeOffPoint(null));
dispatch(setSelectedTakeOffPointOption('current_location'));
},
[dispatch],
);
Expand Down

0 comments on commit b330474

Please sign in to comment.