1. Removed Prev. and Body Weight % elements from the session logging screen. 2. Added logged set editing.

This commit is contained in:
aodulov
2025-11-26 09:44:57 +02:00
parent 34738697df
commit 85a351ea4e
3 changed files with 152 additions and 52 deletions

13
App.tsx
View File

@@ -134,6 +134,18 @@ function App() {
}
};
const handleUpdateSetInActive = (updatedSet: WorkoutSet) => {
if (activeSession) {
setActiveSession(prev => {
if (!prev) return null;
return {
...prev,
sets: prev.sets.map(s => s.id === updatedSet.id ? updatedSet : s)
};
});
}
};
const handleUpdateSession = (updatedSession: WorkoutSession) => {
if (!currentUser) return;
saveSession(currentUser.id, updatedSession);
@@ -169,6 +181,7 @@ function App() {
onSessionEnd={handleEndSession}
onSetAdded={handleAddSet}
onRemoveSet={handleRemoveSetFromActive}
onUpdateSet={handleUpdateSetInActive}
lang={language}
/>
)}