From aff82a818596e35c0278fa67dd70243c48300102 Mon Sep 17 00:00:00 2001 From: Brendan Chen Date: Mon, 3 Feb 2025 23:25:53 -0800 Subject: [PATCH] fix binding errors with static method --- src/services/NotificationService.test.ts | 2 ++ src/services/NotificationService.ts | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 src/services/NotificationService.test.ts diff --git a/src/services/NotificationService.test.ts b/src/services/NotificationService.test.ts new file mode 100644 index 0000000..fb3ff70 --- /dev/null +++ b/src/services/NotificationService.test.ts @@ -0,0 +1,2 @@ +import { NotificationService } from './NotificationService'; + diff --git a/src/services/NotificationService.ts b/src/services/NotificationService.ts index 9d637f0..1a66870 100644 --- a/src/services/NotificationService.ts +++ b/src/services/NotificationService.ts @@ -25,7 +25,6 @@ export class NotificationService { this.reloadAPNsTokenIfTimePassed = this.reloadAPNsTokenIfTimePassed.bind(this); this.lastReloadedTimeForAPNsIsTooRecent = this.lastReloadedTimeForAPNsIsTooRecent.bind(this); this.sendEtaNotificationImmediately = this.sendEtaNotificationImmediately.bind(this); - this.getAPNsFullUrlToUse = this.getAPNsFullUrlToUse.bind(this); this.etaSubscriberCallback = this.etaSubscriberCallback.bind(this); this.sendEtaNotificationImmediatelyIfSecondsRemainingBelowThreshold = this.sendEtaNotificationImmediatelyIfSecondsRemainingBelowThreshold.bind(this); this.scheduleNotification = this.scheduleNotification.bind(this); @@ -75,7 +74,7 @@ export class NotificationService { private async sendEtaNotificationImmediately({ deviceId, shuttleId, stopId }: ScheduledNotificationData): Promise { this.reloadAPNsTokenIfTimePassed(); - const url = this.getAPNsFullUrlToUse(deviceId); + const url = NotificationService.getAPNsFullUrlToUse(deviceId); const shuttle = await this.repository.getShuttleById(shuttleId); const stop = await this.repository.getStopById(stopId);