|
|
@ -125,8 +125,9 @@ export const StatusContextProvider = ({children}) => { |
|
|
|
|
|
|
|
async function resume() { |
|
|
|
const activeWorkouts = await fetchActiveWorkouts(); |
|
|
|
const count = activeWorkouts.length; |
|
|
|
const last = count > 0 ? activeWorkouts[count - 1] : null; |
|
|
|
const activeAndConnected = activeWorkouts.filter(w => w.status !== "disconnected"); |
|
|
|
const count = activeAndConnected.length; |
|
|
|
const last = count > 0 ? activeAndConnected[count - 1] : null; |
|
|
|
|
|
|
|
if (last !== null) { |
|
|
|
setProgram(last.program); |
|
|
|