|
@ -18,6 +18,7 @@ interface Option { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const skipMessages = ["Ikke hopp over", "Hopp over straks", "Hopp over nå"]; |
|
|
const skipMessages = ["Ikke hopp over", "Hopp over straks", "Hopp over nå"]; |
|
|
|
|
|
const ENABLE_SKIP = false; |
|
|
|
|
|
|
|
|
export function ControlsBoi() { |
|
|
export function ControlsBoi() { |
|
|
const {workout, disconnect, start, stop, setLevel, skip} = useContext(RuntimeContext); |
|
|
const {workout, disconnect, start, stop, setLevel, skip} = useContext(RuntimeContext); |
|
@ -40,13 +41,13 @@ export function ControlsBoi() { |
|
|
if (workout.status === WorkoutStatus.Started) { |
|
|
if (workout.status === WorkoutStatus.Started) { |
|
|
btnList.push({icon: faPause, onClick: stop}); |
|
|
btnList.push({icon: faPause, onClick: stop}); |
|
|
|
|
|
|
|
|
if (workout.program) { |
|
|
|
|
|
|
|
|
if (workout.program && ENABLE_SKIP) { |
|
|
const text = nextSkip > 0 ? `${nextSkip - lastTime} sek.` : ""; |
|
|
const text = nextSkip > 0 ? `${nextSkip - lastTime} sek.` : ""; |
|
|
|
|
|
|
|
|
btnList.push({icon: faFastForward, text, warning: nextSkip >= 0, onClick: () => setMode("skip")}); |
|
|
btnList.push({icon: faFastForward, text, warning: nextSkip >= 0, onClick: () => setMode("skip")}); |
|
|
} else { |
|
|
|
|
|
btnList.push({icon: faArrowUpRightDots, onClick: () => setMode("level")}); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
btnList.push({icon: faArrowUpRightDots, onClick: () => setMode("level")}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (isStopped) { |
|
|
if (isStopped) { |
|
@ -104,10 +105,10 @@ export function ControlsBoi() { |
|
|
}, [workout, disconnect]); |
|
|
}, [workout, disconnect]); |
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
useEffect(() => { |
|
|
if (lastState?.level && mode === "level") { |
|
|
|
|
|
|
|
|
if (lastState?.level && mode === "level" && sel === 0) { |
|
|
setSel(lastState.level - 1); |
|
|
setSel(lastState.level - 1); |
|
|
} |
|
|
} |
|
|
}, [lastState, mode]); |
|
|
|
|
|
|
|
|
}, [lastState, mode, sel]); |
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
useEffect(() => { |
|
|
if (lastState?.time) { |
|
|
if (lastState?.time) { |
|
|