fix: keep save button visible when keyboard open, auto-sync after save
This commit is contained in:
parent
049473c696
commit
1bad7684bc
1 changed files with 17 additions and 11 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue