From 62df30de8ae365cb50637b88b282d56a1a9d78d5 Mon Sep 17 00:00:00 2001 From: Julia Friesel Date: Fri, 7 Feb 2020 09:53:11 +0100 Subject: [PATCH] De-duplicate line --- lib/set-new-cycle-start.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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) }