Use nfp mode setting in sympto adapter
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import getFertilityStatus from './sympto'
|
||||
import cycleModule from './cycle'
|
||||
import { fertilityStatus } from '../i18n/en/labels'
|
||||
import { useCervixObservable } from '../local-storage'
|
||||
|
||||
export function getFertilityStatusForDay(dateString) {
|
||||
const status = getCycleStatusForDay(dateString)
|
||||
@@ -48,6 +49,8 @@ export function getCycleStatusForDay(dateString, opts = {}) {
|
||||
}
|
||||
}
|
||||
|
||||
cycleInfo.secondarySymptom = useCervixObservable.value ? 'cervix' : 'mucus'
|
||||
|
||||
return getFertilityStatus(cycleInfo)
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,6 @@ export const useCervixObservable = Observable()
|
||||
setObvWithInitValue('useCervix', useCervixObservable, false)
|
||||
|
||||
export async function saveUseCervix(bool) {
|
||||
console.log('saving cervix to', bool)
|
||||
await AsyncStorage.setItem('useCervix', JSON.stringify(bool))
|
||||
useCervixObservable.set(bool)
|
||||
}
|
||||
@@ -63,8 +62,6 @@ export async function saveEncryptionFlag(bool) {
|
||||
|
||||
async function setObvWithInitValue(key, obv, defaultValue) {
|
||||
const result = await AsyncStorage.getItem(key)
|
||||
console.log('result from db for key')
|
||||
console.log(result)
|
||||
let value
|
||||
if (result) {
|
||||
value = JSON.parse(result)
|
||||
|
||||
Reference in New Issue
Block a user