|
@ -51,9 +51,13 @@ export const StatusContextProvider = ({children}) => { |
|
|
if (cooldownMin === -1) { |
|
|
if (cooldownMin === -1) { |
|
|
setWorkout(await updateCooldownMins(workout, minutes + 1)); |
|
|
setWorkout(await updateCooldownMins(workout, minutes + 1)); |
|
|
} else if (minutes < cooldownMin) { |
|
|
} else if (minutes < cooldownMin) { |
|
|
setWorkout(await updateCooldownMins(workout, -1)); |
|
|
|
|
|
|
|
|
if (state === "connected") { |
|
|
|
|
|
setWorkout(await updateCooldownMins(workout, minutes)); |
|
|
|
|
|
} else { |
|
|
|
|
|
setWorkout(await updateCooldownMins(workout, -1)); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
}, [workout, workoutStatus]); |
|
|
|
|
|
|
|
|
}, [workout, workoutStatus, state]); |
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
useEffect(() => { |
|
|
if (bikes !== null && bikes.length === 1) { |
|
|
if (bikes !== null && bikes.length === 1) { |
|
|