Fix adding new set from homepage

This commit is contained in:
Brandon Presley 2022-10-31 20:59:40 +13:00
parent 09ee09f509
commit b782d66bf2
1 changed files with 14 additions and 12 deletions

View File

@ -73,18 +73,20 @@ export default function SetList() {
const onAdd = useCallback(async () => { const onAdd = useCallback(async () => {
console.log(`${SetList.name}.onAdd`, {set}) console.log(`${SetList.name}.onAdd`, {set})
const [{now}] = await getNow() const [{now}] = await getNow()
navigation.navigate('EditSet', { const newSet: GymSet = set || {
set: set || { hidden: false,
hidden: false, minutes: 3,
minutes: 3, name: '',
name: '', reps: 0,
reps: 0, seconds: 30,
seconds: 30, sets: 3,
sets: 3, weight: 0,
weight: 0, created: now,
created: now, image: '',
}, unit: 'kg',
}) }
delete newSet.id
navigation.navigate('EditSet', {set: newSet})
}, [navigation, set]) }, [navigation, set])
const search = useCallback( const search = useCallback(