When nothing entered, delete entry

This commit is contained in:
Julia Friesel
2019-05-12 12:47:05 +02:00
parent 08fd3afc34
commit ecf3ebf16d
10 changed files with 101 additions and 39 deletions
+8 -3
View File
@@ -5,7 +5,6 @@ import {
ScrollView
} from 'react-native'
import styles from '../../../styles'
import { saveSymptom } from '../../../db'
import { bleeding } from '../../../i18n/en/cycle-day'
import ActionButtonFooter from './action-button-footer'
import SelectTabGroup from '../select-tab-group'
@@ -23,8 +22,14 @@ export default class Bleeding extends SymptomView {
}
}
save() {
saveSymptom('bleeding', this.props.date, {
symptomName = 'bleeding'
onBackButtonPress() {
if (typeof this.state.currentValue != 'number') {
this.deleteSymptomEntry()
return
}
this.saveSymptomEntry({
value: this.state.currentValue,
exclude: this.state.exclude
})