From 5855ea0a348df47338066ce3c03c1a1806f63f30 Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Fri, 23 Feb 2024 16:38:11 +0100 Subject: [PATCH] Move temp off turns fertility off logic out of local storage --- components/settings/customization/index.js | 4 ++++ local-storage.js | 6 ------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/components/settings/customization/index.js b/components/settings/customization/index.js index 1782104..a941e64 100644 --- a/components/settings/customization/index.js +++ b/components/settings/customization/index.js @@ -88,6 +88,10 @@ const Settings = () => { const temperatureTrackingCategoryToggle = (value) => { setTemperatureTrackingCategory(value) saveTemperatureTrackingCategory(value) + if (!value) { + setFertilityTrackingEnabled(false) + saveFertilityTrackingEnabled(false) + } } const mucusTrackingCategoryToggle = (value) => { manageSecondarySymptom(cervixTrackingCategoryObservable.value, value) diff --git a/local-storage.js b/local-storage.js index 2081547..b7ad678 100644 --- a/local-storage.js +++ b/local-storage.js @@ -107,12 +107,6 @@ export async function saveTemperatureTrackingCategory(bool) { temperatureTrackingCategoryObservable.set(bool) if (!temperatureTrackingCategoryObservable.value) { - // if temperature tracking is turned off, the fertility tracking gets disabled - const fertilityTrackingResult = await AsyncStorage.getItem('fertilityTracking') - if (fertilityTrackingResult) { - saveFertilityTrackingEnabled(false) - } - // if temperature tracking is turned off, the temperature reminder gets disabled const tempReminderResult = await AsyncStorage.getItem('tempReminder') if (tempReminderResult && JSON.parse(tempReminderResult).enabled) {