From faad51f4f191ae627cbdbc8b15f9adbaf4a8ace3 Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Wed, 14 Feb 2024 17:49:16 +0100 Subject: [PATCH] Check for FertilityTrackingEnabled on home --- components/Home.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/components/Home.js b/components/Home.js index 783d8c4..af02576 100644 --- a/components/Home.js +++ b/components/Home.js @@ -14,7 +14,10 @@ import { determinePredictionText, formatWithOrdinalSuffix, } from './helpers/home' -import { periodPredictionObservable } from '../local-storage' +import { + fertilityTrackingObservable, + periodPredictionObservable, +} from '../local-storage' import { Colors, Fonts, Sizes, Spacing } from '../styles' import { LocalDate } from '@js-joda/core' @@ -28,11 +31,12 @@ const Home = ({ navigate, setDate }) => { navigate('CycleDay') } + const isFertilityTrackingEnabled = fertilityTrackingObservable.value const todayDateString = LocalDate.now().toString() const { getCycleDayNumber, getPredictedMenses } = cycleModule() const cycleDayNumber = getCycleDayNumber(todayDateString) const { status, phase, statusText } = - getFertilityStatusForDay(todayDateString) + isFertilityTrackingEnabled && getFertilityStatusForDay(todayDateString) const isPeriodPredictionEnabled = periodPredictionObservable.value const prediction = determinePredictionText(getPredictedMenses(), t) @@ -55,7 +59,7 @@ const Home = ({ navigate, setDate }) => { )} - {phase && ( + {isFertilityTrackingEnabled && phase && ( {formatWithOrdinalSuffix(phase)}