@@ -23,7 +23,6 @@ import { atomWithStorage } from "jotai/utils";
23
23
import type { NavigateFunction } from "react-router" ;
24
24
import { $path } from "safe-routes" ;
25
25
import { match } from "ts-pattern" ;
26
- import { withFragment } from "ufo" ;
27
26
import { v4 as randomUUID } from "uuid" ;
28
27
import {
29
28
CURRENT_WORKOUT_KEY ,
@@ -386,7 +385,6 @@ export const addExerciseToCurrentWorkout = async (
386
385
selectedExercises : Array < { name : string ; lot : ExerciseLot } > ,
387
386
) => {
388
387
const draft = createDraft ( currentWorkout ) ;
389
- const idxOfNextExercise = draft . exercises . length ;
390
388
for ( const [ _exerciseIdx , ex ] of selectedExercises . entries ( ) ) {
391
389
const exerciseDetails = await getExerciseDetails ( ex . name ) ;
392
390
const setLot = SetLot . Normal ;
@@ -431,12 +429,5 @@ export const addExerciseToCurrentWorkout = async (
431
429
}
432
430
const finishedDraft = finishDraft ( draft ) ;
433
431
setCurrentWorkout ( finishedDraft ) ;
434
- navigate (
435
- withFragment (
436
- $path ( "/fitness/:action" , {
437
- action : currentWorkout . currentAction ,
438
- } ) ,
439
- idxOfNextExercise . toString ( ) ,
440
- ) ,
441
- ) ;
432
+ navigate ( $path ( "/fitness/:action" , { action : currentWorkout . currentAction } ) ) ;
442
433
} ;
0 commit comments