From d8eeac66ab24785c89105c4651ed64d4e8ebeba9 Mon Sep 17 00:00:00 2001 From: Brandon Presley Date: Sat, 3 Dec 2022 22:29:45 +1300 Subject: [PATCH] Fix starting plan without selecting an item --- PlanItem.tsx | 1 + StartPlan.tsx | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/PlanItem.tsx b/PlanItem.tsx index b29df39..4b0c77a 100644 --- a/PlanItem.tsx +++ b/PlanItem.tsx @@ -45,6 +45,7 @@ export default function PlanItem({ const workout = item.workouts.split(',')[0] let first = await getBestSet(workout) if (!first) first = {...defaultSet, name: workout} + delete first.id navigation.navigate('StartPlan', {plan: item, first}) }, [item, navigation]) diff --git a/StartPlan.tsx b/StartPlan.tsx index 16686a2..54ab506 100644 --- a/StartPlan.tsx +++ b/StartPlan.tsx @@ -2,7 +2,7 @@ import {RouteProp, useFocusEffect, useRoute} from '@react-navigation/native' import {useCallback, useMemo, useRef, useState} from 'react' import {NativeModules, TextInput, View} from 'react-native' import {FlatList} from 'react-native-gesture-handler' -import {Button} from 'react-native-paper' +import {Button, ProgressBar} from 'react-native-paper' import {getBestSet} from './best.service' import {PADDING} from './constants' import CountMany from './count-many' @@ -155,12 +155,17 @@ export default function StartPlan() { ( - + + + + )} /> )}