Merge branch '215-period-reminder-bug' into 'master'

wrongly triggered period reminders (bug)

Closes #215

See merge request bloodyhealth/drip!92
This commit is contained in:
tina
2018-09-28 13:35:18 +00:00
+11 -8
View File
@@ -64,14 +64,17 @@ function setupPeriodReminder() {
.hours(6) .hours(6)
.minutes(0) .minutes(0)
.seconds(0) .seconds(0)
// period is likely to start in 3 to 3 + (length of prediction - 1) days
const daysToEndOfPrediction = bleedingPrediction[0].length + 2
Notification.localNotificationSchedule({ if (reminderDate.isAfter()) {
id: '2', // period is likely to start in 3 to 3 + (length of prediction - 1) days
message: labels.periodReminder.notification(daysToEndOfPrediction), const daysToEndOfPrediction = bleedingPrediction[0].length + 2
date: reminderDate.toDate(),
vibrate: false Notification.localNotificationSchedule({
}) id: '2',
message: labels.periodReminder.notification(daysToEndOfPrediction),
date: reminderDate.toDate(),
vibrate: false
})
}
} }
} }