diff --git a/components/cycle-day/symptoms/temperature.js b/components/cycle-day/symptoms/temperature.js index 07761df..1b77927 100644 --- a/components/cycle-day/symptoms/temperature.js +++ b/components/cycle-day/symptoms/temperature.js @@ -17,9 +17,11 @@ export default class Temp extends Component { this.makeActionButtons = props.makeActionButtons let initialValue - if (this.cycleDay.temperature) { - initialValue = this.cycleDay.temperature.value.toString() - this.time = this.cycleDay.temperature.time + const temp = this.cycleDay.temperature + + if (temp) { + initialValue = temp.value.toString() + this.time = temp.time } else { const prevTemp = getPreviousTemperature(this.cycleDay) initialValue = prevTemp ? prevTemp.toString() : '' @@ -27,8 +29,8 @@ export default class Temp extends Component { this.state = { currentValue: initialValue, - exclude: this.cycleDay.temperature ? this.cycleDay.temperature.exclude : false, - time: this.cycleDay.temperature ? this.cycleDay.temperature.time : null + exclude: temp ? temp.exclude : false, + time: this.time || LocalTime.now().truncatedTo(ChronoUnit.MINUTES).toString() } } @@ -48,7 +50,7 @@ export default class Temp extends Component { value={this.state.currentValue} /> - + Time