diff --git a/components/cycle-day/cycle-day-overview.js b/components/cycle-day/cycle-day-overview.js index d43aab443d4581ab297502825442072baef88093..a4174a4bc59f9415f2f8d9ac2a770892f5104bcd 100644 --- a/components/cycle-day/cycle-day-overview.js +++ b/components/cycle-day/cycle-day-overview.js @@ -62,7 +62,7 @@ export default class DayView extends Component { const mucusFeelingValue = this.cycleDay.mucus && this.cycleDay.mucus.feeling const mucusTextureValue = this.cycleDay.mucus && this.cycleDay.mucus.texture - const mucusComputedValue = this.cycleDay.mucus && this.cycleDay.mucus.computedNfp + const mucusComputedValue = this.cycleDay.mucus && this.cycleDay.mucus.value let mucusLabel if (typeof mucusFeelingValue === 'number' && typeof mucusTextureValue === 'number') { mucusLabel = `${feelingLabels[mucusFeelingValue]} + ${textureLabels[mucusTextureValue]} ( ${computeSensiplanMucusLabels[mucusComputedValue]} )` diff --git a/db.js b/db.js index c0533bf307529a29f65c3f3aea2067d62eb76a29..7f5e3e5c15a8c5bb96777f584a7185fde6a10d1e 100644 --- a/db.js +++ b/db.js @@ -23,7 +23,7 @@ const MucusSchema = { properties: { feeling: 'int', texture: 'int', - computedNfp: 'int', + value: 'int', exclude: 'bool' } } diff --git a/lib/sympto-adapter.js b/lib/sympto-adapter.js index 6d2a489b0dcbf1127254f0da4ad506d9243cd540..79a4742d0c7f5afe750f7b37a5c99f404018fd55 100644 --- a/lib/sympto-adapter.js +++ b/lib/sympto-adapter.js @@ -8,12 +8,12 @@ export default function (dateString) { const cycle = getCycleDaysBeforeDay(dateString) if (!cycle) return fertilityStatus.unknown - // we get earliest last, but sympto wants earliest first - cycle.reverse() const previousCycles = getPreviousCycles(cycle[0]) - previousCycles.forEach(cycle => cycle.reverse()) - const status = getFertilityStatus({cycle, previousCycles}) + const status = getFertilityStatus({ + cycle: formatCycleForSympto(cycle), + previousCycles: previousCycles.map(formatCycleForSympto) + }) return formatStatusForApp(status) } @@ -24,4 +24,10 @@ function formatStatusForApp(status) { } else { return fertilityStatus.infertile } +} + +function formatCycleForSympto(cycle) { + // we get earliest last, but sympto wants earliest first + cycle.reverse() + return cycle } \ No newline at end of file