Minor History fix
This commit is contained in:
10
App.tsx
10
App.tsx
@@ -94,13 +94,19 @@ function App() {
|
||||
setCurrentTab('TRACK');
|
||||
};
|
||||
|
||||
const handleEndSession = () => {
|
||||
const handleEndSession = async () => {
|
||||
if (activeSession && currentUser) {
|
||||
const finishedSession = { ...activeSession, endTime: Date.now() };
|
||||
saveSession(currentUser.id, finishedSession);
|
||||
await saveSession(currentUser.id, finishedSession);
|
||||
setSessions(prev => [finishedSession, ...prev]);
|
||||
setActiveSession(null);
|
||||
setActivePlan(null);
|
||||
|
||||
// Refetch user to get updated weight
|
||||
const res = await getMe();
|
||||
if (res.success && res.user) {
|
||||
setCurrentUser(res.user);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user