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
+13 -2
View File
@@ -1,10 +1,21 @@
import { Component } from 'react'
import { BackHandler } from 'react-native'
import { saveSymptom } from '../../../db'
export default class SymptomView extends Component {
constructor() {
constructor(props) {
super()
this.backHandler = BackHandler.addEventListener('hardwareBackPress', this.save.bind(this))
this.backHandler = BackHandler.addEventListener('hardwareBackPress', this.onBackButtonPress.bind(this))
this.symptomName = props.symptomName
this.date = props.date
}
saveSymptomEntry(entry) {
saveSymptom(this.symptomName, this.date, entry)
}
deleteSymptomEntry() {
saveSymptom(this.symptomName, this.date)
}
componentWillUnmount() {