1. Removed Prev. and Body Weight % elements from the session logging screen. 2. Added logged set editing.
This commit is contained in:
13
App.tsx
13
App.tsx
@@ -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}
|
||||
/>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user