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