fix: keep save button visible when keyboard open, auto-sync after save

This commit is contained in:
Eddy de Vink 2026-06-27 23:40:14 +02:00
commit 1bad7684bc

View file

@ -30,9 +30,17 @@ export default function NewMeasurementScreen({ navigation }: Props) {
const handleSubmit = async (m: Measurement) => {
await initDatabase()
await insertMeasurement(m)
Alert.alert('Opgeslagen', 'Meting is opgeslagen', [
{ text: 'OK', onPress: () => navigation.goBack() },
])
try {
const { syncAll } = await import('../sync/syncService')
await syncAll()
Alert.alert('Opgeslagen & gesynct', 'Meting is opgeslagen en gesynchroniseerd', [
{ text: 'OK', onPress: () => navigation.goBack() },
])
} catch {
Alert.alert('Opgeslagen', 'Meting is opgeslagen (sync mislukt)', [
{ text: 'OK', onPress: () => navigation.goBack() },
])
}
}
if (latest === undefined) {