Wait for data before displaying workouts on plans

Closes #92
This commit is contained in:
Brandon Presley 2022-10-16 17:20:13 +13:00
parent c05a76ed1a
commit ae947d5405
1 changed files with 23 additions and 20 deletions

View File

@ -166,6 +166,7 @@ export default function StartPlan() {
innerRef={unitRef} innerRef={unitRef}
/> />
)} )}
{counts && distinctSets && (
<FlatList <FlatList
data={workouts} data={workouts}
renderItem={({item, index}) => ( renderItem={({item, index}) => (
@ -174,7 +175,8 @@ export default function StartPlan() {
description={getDescription(item)} description={getDescription(item)}
onPress={() => select(index)} onPress={() => select(index)}
left={() => ( left={() => (
<View style={{alignItems: 'center', justifyContent: 'center'}}> <View
style={{alignItems: 'center', justifyContent: 'center'}}>
<RadioButton <RadioButton
onPress={() => select(index)} onPress={() => select(index)}
value={index.toString()} value={index.toString()}
@ -186,6 +188,7 @@ export default function StartPlan() {
/> />
)} )}
/> />
)}
</View> </View>
<Button mode="contained" icon="save" onPress={handleSubmit}> <Button mode="contained" icon="save" onPress={handleSubmit}>
Save Save