Skip to content
Snippets Groups Projects
Commit 4b469f2f authored by Julia Friesel's avatar Julia Friesel
Browse files

Make isDeleteIconActive more readable

parent 25ed0d16
No related branches found
No related tags found
No related merge requests found
......@@ -44,11 +44,17 @@ export default class SymptomView extends Component {
}
isDeleteIconActive() {
return Object.keys(this.state).some(key => {
const symptomValueHasBeenFilledOut = key => {
// the state tracks whether the symptom info should be shown,
// we ignore that property
if (key === 'showInfo') return
// is there any meaningful value in the current state?
return this.state[key] || this.state[key] === 0
})
}
const symptomValues = Object.keys(this.state)
return symptomValues.some(symptomValueHasBeenFilledOut)
}
render() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment