Fixes reopenning after back button

This commit is contained in:
Sofiya Tepikin
2019-05-30 23:27:53 +02:00
parent a152b497fb
commit fa20e84bfe
2 changed files with 9 additions and 1 deletions
+5 -1
View File
@@ -12,6 +12,7 @@ import settingsViews from './settings'
import Stats from './stats'
import {headerTitles, menuTitles} from '../i18n/en/labels'
import setupNotifications from '../lib/notifications'
import { closeDb } from '../db'
// design wants everyhting lowercased, but we don't
// have CSS pseudo properties
@@ -55,7 +56,10 @@ export default class App extends Component {
handleBackButtonPress = () => {
const { currentPage, currentProps } = this.state
if (currentPage === HOME_PAGE) return false
if (currentPage === HOME_PAGE) {
closeDb()
return false
}
if (this.isSymptomView()) {
this.navigate(
this.originForSymptomView, { date: currentProps.date }