Pause and retroactively start cooldown.

This commit is contained in:
2020-05-20 06:18:11 +00:00
parent a527a88bdb
commit 486aa11e73
+5 -1
View File
@@ -51,9 +51,13 @@ export const StatusContextProvider = ({children}) => {
if (cooldownMin === -1) {
setWorkout(await updateCooldownMins(workout, minutes + 1));
} else if (minutes < cooldownMin) {
if (state === "connected") {
setWorkout(await updateCooldownMins(workout, minutes));
}
setWorkout(await updateCooldownMins(workout, -1));
}
}, [workout, workoutStatus]);
}, [workout, workoutStatus, state]);
useEffect(() => {
if (bikes !== null && bikes.length === 1) {