Browse Source

Merge branch 'master' of git.aiterp.net:stian/trimlog-ykonsole-chrome-extension

master
Stian Fredrik Aune 4 years ago
parent
commit
908a2ebfe9
  1. 2
      my-bois/src/components/Bois.jsx
  2. 8
      my-bois/src/components/Contexts.jsx

2
my-bois/src/components/Bois.jsx

@ -121,7 +121,7 @@ export const CentreBoi = () => {
useKey(["H", "h"], () => showHide()); useKey(["H", "h"], () => showHide());
useKey("*", () => { useKey("*", () => {
if (state === "started") {
if (state === "started" || state === "connected") {
toggleCooldown(); toggleCooldown();
} }
}); });

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

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

Loading…
Cancel
Save