Skip to content
Snippets Groups Projects
Commit 16d2afaf authored by BloodyMarie's avatar BloodyMarie
Browse files

Fix: Target reminder with correct id

parent 2a49e430
No related branches found
No related tags found
No related merge requests found
......@@ -9,7 +9,7 @@ import nothingChanged from '../db/db-unchanged'
export default function setupNotifications(navigate) {
Notification.configure({
onNotification: (notification) => {
if (notification.id === '1') {
if (notification.data.id === '11' || notification.id === '1') {
navigate('TemperatureEditView')
} else {
navigate('Home')
......@@ -18,7 +18,7 @@ export default function setupNotifications(navigate) {
})
tempReminderObservable(reminder => {
Notification.cancelLocalNotifications({id: '1'})
Notification.cancelLocalNotifications({id: '11'})
if (reminder.enabled) {
const [hours, minutes] = reminder.time.split(':')
let target = new Moment()
......@@ -32,6 +32,7 @@ export default function setupNotifications(navigate) {
Notification.localNotificationSchedule({
id: '1',
userInfo: { id: '11' },
message: labels.tempReminder.notification,
date: target.toDate(),
vibrate: false,
......@@ -41,7 +42,7 @@ export default function setupNotifications(navigate) {
}, false)
periodReminderObservable(reminder => {
Notification.cancelLocalNotifications({id: '2'})
Notification.cancelLocalNotifications({id: '22'})
if (reminder.enabled) setupPeriodReminder()
}, false)
......@@ -71,6 +72,7 @@ function setupPeriodReminder() {
Notification.localNotificationSchedule({
id: '2',
userInfo: { id: '22' },
message: labels.periodReminder.notification(daysToEndOfPrediction),
date: reminderDate.toDate(),
vibrate: false
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment