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,8 +73,7 @@ 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: '',
@ -83,8 +82,11 @@ export default function SetList() {
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(