From 7a7c8b20b953681cae30d688034d057b3075e007 Mon Sep 17 00:00:00 2001 From: Brandon Presley Date: Sat, 3 Sep 2022 14:48:56 +1200 Subject: [PATCH] Prioritize todays workout over the last set When predicting the next set, if one set is from a previous workout, rather than switching to that workout we should start todays plan instead. --- SetList.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SetList.tsx b/SetList.tsx index 0d1dfdc..b080157 100644 --- a/SetList.tsx +++ b/SetList.tsx @@ -117,7 +117,7 @@ export default function SetList() { const todaysWorkouts = todaysPlan[0].workouts.split(','); let workout = todaysWorkouts[0]; console.log(`${SetList.name}.predict:`, {todaysSets, todaysWorkouts}); - if (todaysSets.length > 0) { + if (todaysWorkouts.includes(todaysSets[0].name) && todaysSets.length > 0) { const count = todaysSets.filter( s => s.name === todaysSets[0].name, ).length;