Skip to content

Commit

Permalink
close popup on skip fishing
Browse files Browse the repository at this point in the history
  • Loading branch information
DovMa committed Dec 1, 2023
1 parent d7d4075 commit 7e4638b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/containers/FishingLocation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@ const useLocationMutation = (onSuccess: (value: any) => void) => {
return { getLocation, locationLoading };
};

const useSkipMutation = () => {
const useSkipMutation = (onSuccess: () => void) => {
const { isLoading: skipLoading, mutateAsync: skipFishing } = useMutation(api.skipFishing, {
onError: ({ response }) => {
handleAlert(response);
},
onSuccess,
retry: false,
});
return { skipLoading, skipFishing };
Expand Down Expand Up @@ -64,7 +65,7 @@ const FishingLocation = ({ setLocation, location, coordinates }: any) => {
const [locationType, setLocationType] = useState<LocationType | null>(null);

const { startFishing, startLoading } = useStartMutation();
const { skipFishing, skipLoading } = useSkipMutation();
const { skipFishing, skipLoading } = useSkipMutation(() => setShowSkipFishing(false));
const { getLocation, locationLoading } = useLocationMutation((value) => setLocation(value));

const handleSelectLocation = (type: LocationType) => () => {
Expand Down

0 comments on commit 7e4638b

Please sign in to comment.