Skip to content

Commit

Permalink
location fix
Browse files Browse the repository at this point in the history
  • Loading branch information
DovMa committed Nov 24, 2023
1 parent d28ed74 commit f07773f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/components/containers/FishingActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ import { RootState } from '../../state/store';

interface FishingActionsProps {
fishing: Fishing;
coordinates: any;
}
const FishingActions = ({ fishing }: FishingActionsProps) => {
const FishingActions = ({ fishing, coordinates }: FishingActionsProps) => {
const queryClient = useQueryClient();
const [showFinishFishing, setShowFinishFishing] = useState(false);
const navigate = useNavigate();
const coordinates = useSelector((state: RootState) => state.fishing.coordinates);

const { mutateAsync: finishFishing, isLoading: finishFishingLoading } = useMutation(
api.finishFishing,
Expand All @@ -54,6 +54,7 @@ const FishingActions = ({ fishing }: FishingActionsProps) => {
);

const handleFinishFishing = () => {
console.log('handleFinishFishing', coordinates);
if (coordinates) {
finishFishing({ coordinates });
}
Expand Down
4 changes: 3 additions & 1 deletion src/pages/CurrentFishing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ export const CurrentFishing = () => {
return (
<DefaultLayout>
{currentRoute?.slug === slugs.fishingLocation && <FishingLocation />}
{currentRoute?.slug === slugs.fishingCurrent && <FishingActions fishing={currentFishing} />}
{currentRoute?.slug === slugs.fishingCurrent && (
<FishingActions fishing={currentFishing} coordinates={coordinates} />
)}
{currentRoute?.slug === slugs.fishingTools && (
<FishingTools setLocation={setLocation} location={location} coordinates={coordinates} />
)}
Expand Down

0 comments on commit f07773f

Please sign in to comment.