diff --git a/lib/set-new-cycle-start.js b/lib/set-new-cycle-start.js index bdc6872..34b5a69 100644 --- a/lib/set-new-cycle-start.js +++ b/lib/set-new-cycle-start.js @@ -1,11 +1,13 @@ export default function ({ 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 + + 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.bleeding = val cycleDay.isCycleStart = false if (!mensesDaysAfter.length) return const nextOne = mensesDaysAfter[mensesDaysAfter.length - 1] @@ -13,7 +15,6 @@ export default function ({ nextOne.isCycleStart = true } } else { - cycleDay.bleeding = val cycleDay.isCycleStart = checkIsMensesStart(cycleDay) maybeClearOldCycleStarts(cycleDay) }