Fix labels and clean up code

This commit is contained in:
Liv
2023-11-20 11:50:46 +01:00
committed by bl00dymarie
parent 9fbe99e23b
commit 583c9c032c
5 changed files with 19 additions and 29 deletions
+2 -2
View File
@@ -65,6 +65,7 @@ export function getBleedingDaysSortedByDate() {
return db
.objects('CycleDay')
.filtered('bleeding != null')
.filtered('bleeding.value != null')
.sorted('date', true)
}
export function getTemperatureDaysSortedByDate() {
@@ -88,9 +89,8 @@ export function getCycleStartsSortedByDate() {
export function saveSymptom(symptom, date, val) {
let cycleDay = getCycleDay(date)
if (!cycleDay) cycleDay = createCycleDay(date)
db.write(() => {
if (symptom === 'bleeding') {
if (symptom === 'bleeding' && val != null && val.value != null) {
const mensesDaysAfter = getMensesDaysRightAfter(cycleDay)
maybeSetNewCycleStart({
val,