fix saving of secondary symptom
This commit is contained in:
@@ -82,15 +82,12 @@ const Settings = () => {
|
|||||||
setTemperatureTrackingCategory(value)
|
setTemperatureTrackingCategory(value)
|
||||||
saveTemperatureTrackingCategory(value)
|
saveTemperatureTrackingCategory(value)
|
||||||
}
|
}
|
||||||
|
|
||||||
const mucusTrackingCategoryToggle = (value) => {
|
const mucusTrackingCategoryToggle = (value) => {
|
||||||
manageSecondarySymptom(cervixTrackingCategoryObservable.value, value)
|
manageSecondarySymptom(cervixTrackingCategoryObservable.value, value)
|
||||||
}
|
}
|
||||||
|
|
||||||
const cervixTrackingCategoryToggle = (value) => {
|
const cervixTrackingCategoryToggle = (value) => {
|
||||||
manageSecondarySymptom(value, mucusTrackingCategoryObservable.value)
|
manageSecondarySymptom(value, mucusTrackingCategoryObservable.value)
|
||||||
}
|
}
|
||||||
|
|
||||||
const sexTrackingCategoryToggle = (value) => {
|
const sexTrackingCategoryToggle = (value) => {
|
||||||
setSexTrackingCategory(value)
|
setSexTrackingCategory(value)
|
||||||
saveSexTrackingCategory(value)
|
saveSexTrackingCategory(value)
|
||||||
@@ -119,7 +116,6 @@ const Settings = () => {
|
|||||||
? labels.periodPrediction.on
|
? labels.periodPrediction.on
|
||||||
: labels.periodPrediction.off
|
: labels.periodPrediction.off
|
||||||
|
|
||||||
// used to be onCervixToggle
|
|
||||||
const secondarySymptomButtons = [
|
const secondarySymptomButtons = [
|
||||||
{
|
{
|
||||||
label: labels.secondarySymptom.mucus,
|
label: labels.secondarySymptom.mucus,
|
||||||
@@ -146,15 +142,16 @@ const Settings = () => {
|
|||||||
)
|
)
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
// shoutUseCervix changed to 0/1 instead of false/true
|
|
||||||
const manageSecondarySymptom = (cervix, mucus) => {
|
const manageSecondarySymptom = (cervix, mucus) => {
|
||||||
if (!cervix && mucus) {
|
if (!cervix && mucus) {
|
||||||
setUseCervixAsSecondarySymptom(0)
|
setUseCervixAsSecondarySymptom(0)
|
||||||
|
saveUseCervixAsSecondarySymptom(0)
|
||||||
setIsSecondarySymptomDisabled(false)
|
setIsSecondarySymptomDisabled(false)
|
||||||
} else if (cervix && mucus) {
|
} else if (cervix && mucus) {
|
||||||
setIsSecondarySymptomDisabled(false)
|
setIsSecondarySymptomDisabled(false)
|
||||||
} else if (cervix && !mucus) {
|
} else if (cervix && !mucus) {
|
||||||
setUseCervixAsSecondarySymptom(1)
|
setUseCervixAsSecondarySymptom(1)
|
||||||
|
saveUseCervixAsSecondarySymptom(1)
|
||||||
setIsSecondarySymptomDisabled(false)
|
setIsSecondarySymptomDisabled(false)
|
||||||
} else if (!cervix && !mucus) {
|
} else if (!cervix && !mucus) {
|
||||||
setIsSecondarySymptomDisabled(true)
|
setIsSecondarySymptomDisabled(true)
|
||||||
@@ -163,7 +160,6 @@ const Settings = () => {
|
|||||||
saveMucusTrackingCategory(mucus)
|
saveMucusTrackingCategory(mucus)
|
||||||
setCervixTrackingCategory(cervix)
|
setCervixTrackingCategory(cervix)
|
||||||
saveCervixTrackingCategory(cervix)
|
saveCervixTrackingCategory(cervix)
|
||||||
saveUseCervixAsSecondarySymptom(useCervixAsSecondarySymptom)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const secondarySymptomDisabledPrompt = () => {
|
const secondarySymptomDisabledPrompt = () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user