De-duplicate line

This commit is contained in:
Julia Friesel
2020-02-07 09:53:11 +01:00
parent ae0d909407
commit 62df30de8a
+6 -5
View File
@@ -1,11 +1,13 @@
export default function ({ export default function ({
val, cycleDay, mensesDaysAfter, checkIsMensesStart val, cycleDay, mensesDaysAfter, checkIsMensesStart
}) { }) {
// if a bleeding value is deleted or excluded, we need to check if
// there are any following bleeding days and if the
// next one of them is now a cycle start
if (bleedingValueDeletedOrExluded(val)) {
cycleDay.bleeding = val cycleDay.bleeding = val
// if a bleeding value is deleted or excluded, we need to check if there are
// any following bleeding days and if the next one of them is now a cycle
// start
if (bleedingValueDeletedOrExluded(val)) {
cycleDay.isCycleStart = false cycleDay.isCycleStart = false
if (!mensesDaysAfter.length) return if (!mensesDaysAfter.length) return
const nextOne = mensesDaysAfter[mensesDaysAfter.length - 1] const nextOne = mensesDaysAfter[mensesDaysAfter.length - 1]
@@ -13,7 +15,6 @@ export default function ({
nextOne.isCycleStart = true nextOne.isCycleStart = true
} }
} else { } else {
cycleDay.bleeding = val
cycleDay.isCycleStart = checkIsMensesStart(cycleDay) cycleDay.isCycleStart = checkIsMensesStart(cycleDay)
maybeClearOldCycleStarts(cycleDay) maybeClearOldCycleStarts(cycleDay)
} }