Rename to useCervixAsSecondarySymptomObservable
This commit is contained in:
@@ -28,7 +28,7 @@ import {
|
|||||||
saveTemperatureTrackingCategory,
|
saveTemperatureTrackingCategory,
|
||||||
saveUseCervix,
|
saveUseCervix,
|
||||||
periodPredictionObservable,
|
periodPredictionObservable,
|
||||||
useCervixObservable,
|
useCervixAsSecondarySymptomObservable,
|
||||||
} from '../../../local-storage'
|
} from '../../../local-storage'
|
||||||
import { Colors } from '../../../styles'
|
import { Colors } from '../../../styles'
|
||||||
import labels from '../../../i18n/en/settings'
|
import labels from '../../../i18n/en/settings'
|
||||||
@@ -36,7 +36,7 @@ import { SYMPTOMS } from '../../../config'
|
|||||||
|
|
||||||
const Settings = () => {
|
const Settings = () => {
|
||||||
const [shouldUseCervix, setShouldUseCervix] = useState(
|
const [shouldUseCervix, setShouldUseCervix] = useState(
|
||||||
useCervixObservable.value
|
useCervixAsSecondarySymptomObservable.value
|
||||||
)
|
)
|
||||||
|
|
||||||
const [isPeriodPredictionEnabled, setPeriodPrediction] = useState(
|
const [isPeriodPredictionEnabled, setPeriodPrediction] = useState(
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import getFertilityStatus from 'sympto'
|
import getFertilityStatus from 'sympto'
|
||||||
import cycleModule from './cycle'
|
import cycleModule from './cycle'
|
||||||
import { useCervixObservable } from '../local-storage'
|
import { useCervixAsSecondarySymptomObservable } from '../local-storage'
|
||||||
import { fertilityStatus as labels } from '../i18n/en/labels'
|
import { fertilityStatus as labels } from '../i18n/en/labels'
|
||||||
|
|
||||||
export function getFertilityStatusForDay(dateString) {
|
export function getFertilityStatusForDay(dateString) {
|
||||||
@@ -57,7 +57,7 @@ export function getCycleStatusForDay(dateString, opts = {}) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cycleInfo.secondarySymptom = useCervixObservable.value ? 'cervix' : 'mucus'
|
cycleInfo.secondarySymptom = useCervixAsSecondarySymptomObservable.value ? 'cervix' : 'mucus'
|
||||||
|
|
||||||
return getFertilityStatus(cycleInfo)
|
return getFertilityStatus(cycleInfo)
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -59,12 +59,12 @@ export async function savePeriodPrediction(bool) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const useCervixObservable = Observable()
|
export const useCervixAsSecondarySymptomObservable = Observable()
|
||||||
setObvWithInitValue('useCervix', useCervixObservable, 0)
|
setObvWithInitValue('useCervix', useCervixAsSecondarySymptomObservable, 0)
|
||||||
|
|
||||||
export async function saveUseCervix(value) {
|
export async function saveUseCervix(value) {
|
||||||
await AsyncStorage.setItem('useCervix', JSON.stringify(value))
|
await AsyncStorage.setItem('useCervix', JSON.stringify(value))
|
||||||
useCervixObservable.set(value)
|
useCervixAsSecondarySymptomObservable.set(value)
|
||||||
}
|
}
|
||||||
|
|
||||||
export const hasEncryptionObservable = Observable()
|
export const hasEncryptionObservable = Observable()
|
||||||
|
|||||||
Reference in New Issue
Block a user