De-duplicate line
This commit is contained in:
@@ -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
|
cycleDay.bleeding = val
|
||||||
// next one of them is now a cycle start
|
|
||||||
|
// 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)) {
|
if (bleedingValueDeletedOrExluded(val)) {
|
||||||
cycleDay.bleeding = 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)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user