When nothing entered, delete entry
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user