Ignore 0 -> 1 mucus shift

This commit is contained in:
Julia Friesel
2018-08-01 16:21:50 +02:00
parent 6ac642b91c
commit 8bbf122d12
2 changed files with 34 additions and 3 deletions
+5 -1
View File
@@ -1,4 +1,5 @@
export default function (cycleDays, tempEvalEndIndex) {
const notDetected = { detected: false}
const mucusDays = cycleDays.filter(day => day.mucus && !day.mucus.exclude)
let currentBestQuality = 0
@@ -9,6 +10,9 @@ export default function (cycleDays, tempEvalEndIndex) {
currentBestQuality = day.mucus.value
}
// if mucus only changes from dry to nothing, it doesn't constitute a shift
if (currentBestQuality < 2) continue
if (day.mucus.value !== currentBestQuality) continue
// the three following days must be of lower quality
@@ -40,6 +44,6 @@ export default function (cycleDays, tempEvalEndIndex) {
}
}
return { detected: false }
return notDetected
}