Skip to content

Commit

Permalink
chore(frontend): manual redirect to start workout
Browse files Browse the repository at this point in the history
  • Loading branch information
IgnisDa committed Nov 23, 2024
1 parent 7f40c71 commit beeb292
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions apps/frontend/app/lib/hooks.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { useComputedColorScheme, useMantineTheme } from "@mantine/core";
import { useForceUpdate, useListState } from "@mantine/hooks";
import {
useNavigate,
useRevalidator,
useRouteLoaderData,
useSearchParams,
Expand Down Expand Up @@ -97,13 +96,12 @@ export const useConfirmSubmit = () => {
};

export const useGetWorkoutStarter = () => {
const navigate = useNavigate();
const revalidator = useRevalidator();
const [_, setCurrentWorkout] = useCurrentWorkout();

const fn = (wkt: InProgressWorkout, action: FitnessAction) => {
setCurrentWorkout(wkt);
navigate($path("/fitness/:action", { action }));
window.location.href = $path("/fitness/:action", { action });
revalidator.revalidate();
};
return fn;
Expand Down

0 comments on commit beeb292

Please sign in to comment.