From 84be9900def9e02ff3ffb178bfcb91ef67167711 Mon Sep 17 00:00:00 2001 From: emelko Date: Thu, 17 Jan 2019 11:04:14 +0100 Subject: [PATCH] Handles the back navigation from info symptom to CycleDay --- components/app.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/components/app.js b/components/app.js index 3675741..73403d6 100644 --- a/components/app.js +++ b/components/app.js @@ -51,7 +51,8 @@ export default class App extends Component { if (isMenuItem(this.state.currentPage)) { this.menuOrigin = this.state.currentPage } - if (this.state.currentPage !== 'InfoSymptom') { + if (!isSymptomView(this.state.currentPage) && + this.state.currentPage !== 'InfoSymptom') { this.originForSymptomView = this.state.currentPage } this.setState({currentPage: pageName, currentProps: props}) @@ -69,8 +70,10 @@ export default class App extends Component { this.navigate(this.menuOrigin) } else if (this.state.currentPage === 'InfoSymptom') { this.navigate( - this.originForSymptomView, { date: this.state.currentProps.date } - ) + this.state.currentProps.symptomView, { + date: this.state.currentProps.date, + cycleDay: this.state.currentProps.cycleDay + }) } else { this.navigate('Home') }