From e56be146f47b1cf94e5005171441ad9fb2d3cc2a Mon Sep 17 00:00:00 2001 From: Derk Weijers Date: Wed, 5 Aug 2020 09:52:09 +0200 Subject: [PATCH] Updated the notification logic with new timestamps --- src/stores/Launches.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/stores/Launches.ts b/src/stores/Launches.ts index 7e576daf..50d13309 100644 --- a/src/stores/Launches.ts +++ b/src/stores/Launches.ts @@ -104,9 +104,9 @@ class Launches { if (plannedNotifications.length > 0) { PushNotificationIOS.cancelAllLocalNotifications(); } - if (data.wsstamp){ + if (data.net){ const fireDate = new Date( - (data.wsstamp - this.notifications.delay * 60) * 1000 + (data.net - this.notifications.delay * 60) * 1000 ); PushNotificationIOS.scheduleLocalNotification({ fireDate: fireDate.toISOString(), @@ -121,7 +121,7 @@ class Launches { if (this.notifications.enabled) { PushNotification.cancelAllLocalNotifications(); PushNotification.localNotificationSchedule({ - date: new Date(data.isostart), + date: new Date(data.net).toISOString(), message: `🚀 ${data.name} will launch in ${this.notifications.delay} minutes!`, }); }