Browse Source

Pause and retroactively start cooldown.

master
Stian 5 years ago
parent
commit
486aa11e73
  1. 6
      my-bois/src/components/Contexts.jsx

6
my-bois/src/components/Contexts.jsx

@ -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) {

Loading…
Cancel
Save