Skip to content

Commit

Permalink
Updated the notification logic with new timestamps
Browse files Browse the repository at this point in the history
  • Loading branch information
derkweijers committed Aug 5, 2020
1 parent 5856961 commit e56be14
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/stores/Launches.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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!`,
});
}
Expand Down

0 comments on commit e56be14

Please sign in to comment.