From 4ebec41a0a0d087d988ef491374c52e70a69bcdd Mon Sep 17 00:00:00 2001 From: wunderfisch Date: Fri, 23 Feb 2024 12:16:32 +0100 Subject: [PATCH] fix saving of secondary symptom --- components/settings/customization/index.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/components/settings/customization/index.js b/components/settings/customization/index.js index c2fc692..a0ee520 100644 --- a/components/settings/customization/index.js +++ b/components/settings/customization/index.js @@ -82,15 +82,12 @@ const Settings = () => { setTemperatureTrackingCategory(value) saveTemperatureTrackingCategory(value) } - const mucusTrackingCategoryToggle = (value) => { manageSecondarySymptom(cervixTrackingCategoryObservable.value, value) } - const cervixTrackingCategoryToggle = (value) => { manageSecondarySymptom(value, mucusTrackingCategoryObservable.value) } - const sexTrackingCategoryToggle = (value) => { setSexTrackingCategory(value) saveSexTrackingCategory(value) @@ -119,7 +116,6 @@ const Settings = () => { ? labels.periodPrediction.on : labels.periodPrediction.off - // used to be onCervixToggle const secondarySymptomButtons = [ { label: labels.secondarySymptom.mucus, @@ -146,15 +142,16 @@ const Settings = () => { ) }, []) - // shoutUseCervix changed to 0/1 instead of false/true const manageSecondarySymptom = (cervix, mucus) => { if (!cervix && mucus) { setUseCervixAsSecondarySymptom(0) + saveUseCervixAsSecondarySymptom(0) setIsSecondarySymptomDisabled(false) } else if (cervix && mucus) { setIsSecondarySymptomDisabled(false) } else if (cervix && !mucus) { setUseCervixAsSecondarySymptom(1) + saveUseCervixAsSecondarySymptom(1) setIsSecondarySymptomDisabled(false) } else if (!cervix && !mucus) { setIsSecondarySymptomDisabled(true) @@ -163,7 +160,6 @@ const Settings = () => { saveMucusTrackingCategory(mucus) setCervixTrackingCategory(cervix) saveCervixTrackingCategory(cervix) - saveUseCervixAsSecondarySymptom(useCervixAsSecondarySymptom) } const secondarySymptomDisabledPrompt = () => {