From 5057e1a38efc144c460241f51352eec669d82f5a Mon Sep 17 00:00:00 2001 From: Julia Friesel Date: Mon, 13 May 2019 20:41:57 +0200 Subject: [PATCH] Address MR change requests --- components/cycle-day/symptoms/symptom-view.js | 5 ++--- lib/sympto-adapter.js | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/components/cycle-day/symptoms/symptom-view.js b/components/cycle-day/symptoms/symptom-view.js index 7115826..6a805c8 100644 --- a/components/cycle-day/symptoms/symptom-view.js +++ b/components/cycle-day/symptoms/symptom-view.js @@ -1,5 +1,4 @@ -import React from 'react' -import { Component } from 'react' +import React, { Component } from 'react' import { BackHandler, View } from 'react-native' import { saveSymptom } from '../../../db' import Header from '../../header/symptom-view' @@ -8,9 +7,9 @@ import { headerTitles } from '../../../i18n/en/labels' export default class SymptomView extends Component { constructor(props) { super() + // every specific symptom view provides their own onBackButtonPress method this.backHandler = BackHandler.addEventListener('hardwareBackPress', this.onBackButtonPress.bind(this)) this.globalBackhandler = props.handleBackButtonPress - this.symptomName = props.symptomName this.date = props.date } diff --git a/lib/sympto-adapter.js b/lib/sympto-adapter.js index 5caf8ea..efb6288 100644 --- a/lib/sympto-adapter.js +++ b/lib/sympto-adapter.js @@ -114,7 +114,7 @@ function formatCycleForSympto(cycle) { delete day.cervix } // remove days with incomplete mucus value (because nfp-mucus returns null when that's the case) - if (day.mucus.value === null) { + if (day.mucus && day.mucus.value === null) { delete day.mucus } // change format