Repository: IgnisDa/ryot (language: rust)

Issue:
Bugs in logging workouts/creating templates
1. Create a template with many workouts and a superset in the middle
2. Make sure the superset consists of two duplicate exercises
3. Save the template.
4. Edit the template.
5. Try to delete an exercise in a superset before using the option of delete superset.
6. Try to save template


Discussion / hints:

Fix patch:
diff --git a/apps/frontend/app/lib/state/fitness.ts b/apps/frontend/app/lib/state/fitness.ts
index b7e55e63fa..cebd1d22d1 100644
--- a/apps/frontend/app/lib/state/fitness.ts
+++ b/apps/frontend/app/lib/state/fitness.ts
@@ -376,7 +376,7 @@ export const getRestTimerForSet = async (
 	return restTime;
 };
 
-export const addExerciseToWorkout = async (
+export const addExerciseToCurrentWorkout = async (
 	navigate: NavigateFunction,
 	currentWorkout: InProgressWorkout,
 	userFitnessPreferences: UserFitnessPreferences,
diff --git a/apps/frontend/app/routes/_dashboard.fitness.$action.tsx b/apps/frontend/app/routes/_dashboard.fitness.$action.tsx
index be122eabfd..bf0afeac20 100644
--- a/apps/frontend/app/routes/_dashboard.fitness.$action.tsx
+++ b/apps/frontend/app/routes/_dashboard.fitness.$action.tsx
@@ -2764,15 +2764,15 @@ const ReorderDrawer = (props: {
 	);
 
 	useDidUpdate(() => {
-		const oldOrder = currentWorkout?.exercises.map((e) => e.exerciseId);
-		const newOrder = exerciseElements.map((e) => e.exerciseId);
+		const oldOrder = currentWorkout?.exercises.map((e) => e.identifier);
+		const newOrder = exerciseElements.map((e) => e.identifier);
 		if (!isEqual(oldOrder, newOrder)) {
 			setCurrentWorkout(
 				// biome-ignore lint/suspicious/noExplicitAny: weird errors otherwise
 				produce(currentWorkout, (draft: any) => {
 					draft.exercises = exerciseElements.map((de) =>
 						// biome-ignore lint/suspicious/noExplicitAny: weird errors otherwise
-						draft.exercises.find((e: any) => e.exerciseId === de.exerciseId),
+						draft.exercises.find((e: any) => e.identifier === de.identifier),
 					);
 				}),
 			);
diff --git a/apps/frontend/app/routes/_dashboard.fitness.exercises.item.$id._index.tsx b/apps/frontend/app/routes/_dashboard.fitness.exercises.item.$id._index.tsx
index a316395268..e45b8b5bb8 100644
--- a/apps/frontend/app/routes/_dashboard.fitness.exercises.item.$id._index.tsx
+++ b/apps/frontend/app/routes/_dashboard.fitness.exercises.item.$id._index.tsx
@@ -88,7 +88,7 @@ import {
 	useUserUnitSystem,
 } from "~/lib/hooks";
 import {
-	addExerciseToWorkout,
+	addExerciseToCurrentWorkout,
 	getWorkoutDetailsQuery,
 	useCurrentWorkout,
 	useMergingExercise,
@@ -663,7 +663,7 @@ export default function Page() {
 							radius="xl"
 							size="xl"
 							onClick={async () => {
-								await addExerciseToWorkout(
+								await addExerciseToCurrentWorkout(
 									navigate,
 									currentWorkout,
 									userPreferences.fitness,
diff --git a/apps/frontend/app/routes/_dashboard.fitness.exercises.list.tsx b/apps/frontend/app/routes/_dashboard.fitness.exercises.list.tsx
index 5d4b0e1dcb..489200dec0 100644
--- a/apps/frontend/app/routes/_dashboard.fitness.exercises.list.tsx
+++ b/apps/frontend/app/routes/_dashboard.fitness.exercises.list.tsx
@@ -77,7 +77,7 @@ import {
 	useUserPreferences,
 } from "~/lib/hooks";
 import {
-	addExerciseToWorkout,
+	addExerciseToCurrentWorkout,
 	getExerciseDetailsQuery,
 	getUserExerciseDetailsQuery,
 	useCurrentWorkout,
@@ -311,7 +311,7 @@ export default function Page() {
 						size="xl"
 						disabled={selectedExercises.length === 0}
 						onClick={async () => {
-							await addExerciseToWorkout(
+							await addExerciseToCurrentWorkout(
 								navigate,
 								currentWorkout,
 								userPreferences.fitness,
diff --git a/docs/content/index.md b/docs/content/index.md
index 89b462d1a1..13f08cb651 100644
--- a/docs/content/index.md
+++ b/docs/content/index.md
@@ -20,6 +20,7 @@ services:
     image: ignisda/ryot:v8 # or ghcr.io/ignisda/ryot:v8
     pull_policy: always
     container_name: ryot
+    restart: unless-stopped
     ports:
       - "8000:8000"
     environment:


Test patch: