UUID generation fixed

This commit is contained in:
AG
2025-11-28 18:20:22 +02:00
parent 245b8d3961
commit 4c632e164e
7 changed files with 26 additions and 10 deletions

View File

@@ -2,6 +2,7 @@ import React, { useState } from 'react';
import { X, Dumbbell, User, Flame, Timer as TimerIcon, ArrowUp, ArrowRight, Footprints, Ruler, Percent } from 'lucide-react';
import { ExerciseDef, ExerciseType, Language } from '../types';
import { t } from '../services/i18n';
import { generateId } from '../utils/uuid';
import FilledInput from './FilledInput';
interface ExerciseModalProps {
@@ -43,7 +44,7 @@ const ExerciseModal: React.FC<ExerciseModalProps> = ({ isOpen, onClose, onSave,
}
const newEx: ExerciseDef = {
id: crypto.randomUUID(),
id: generateId(),
name: trimmedName,
type: newType,
...(newType === ExerciseType.BODYWEIGHT && { bodyWeightPercentage: parseFloat(newBwPercentage) || 100 })