Browse Source

Fixed.

master
Stian Aune 5 years ago
parent
commit
cb88625e2c
  1. 5
      my-bois/src/components/Contexts.jsx

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

@ -125,8 +125,9 @@ export const StatusContextProvider = ({children}) => {
async function resume() {
const activeWorkouts = await fetchActiveWorkouts();
const count = activeWorkouts.length;
const last = count > 0 ? activeWorkouts[count - 1] : null;
const activeAndConnected = activeWorkouts.filter(w => w.status !== "disconnected");
const count = activeAndConnected.length;
const last = count > 0 ? activeAndConnected[count - 1] : null;
if (last !== null) {
setProgram(last.program);

Loading…
Cancel
Save