Merge branch '537-bug-temperature-reminder-on-ios' into 'master'

Fix: Target reminder with correct id

Closes #537

See merge request bloodyhealth/drip!389
This commit is contained in:
bl00dymarie
2022-04-15 17:29:19 +00:00
+4 -1
View File
@@ -9,7 +9,8 @@ import nothingChanged from '../db/db-unchanged'
export default function setupNotifications(navigate) {
Notification.configure({
onNotification: (notification) => {
if (notification.id === '1') {
// https://github.com/zo0r/react-native-push-notification/issues/966#issuecomment-479069106
if (notification.data?.id === '1' || notification.id === '1') {
navigate('TemperatureEditView')
} else {
navigate('Home')
@@ -32,6 +33,7 @@ export default function setupNotifications(navigate) {
Notification.localNotificationSchedule({
id: '1',
userInfo: { id: '1' },
message: labels.tempReminder.notification,
date: target.toDate(),
vibrate: false,
@@ -71,6 +73,7 @@ function setupPeriodReminder() {
Notification.localNotificationSchedule({
id: '2',
userInfo: { id: '2' },
message: labels.periodReminder.notification(daysToEndOfPrediction),
date: reminderDate.toDate(),
vibrate: false