From a6ceeb4dfbf149d436fcdc7a04198ad27b78f056 Mon Sep 17 00:00:00 2001 From: Brendan Chen Date: Mon, 24 Mar 2025 09:59:29 -0700 Subject: [PATCH] add optional dependency inject for apple notification sender --- .../schedulers/ETANotificationScheduler.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/notifications/schedulers/ETANotificationScheduler.ts b/src/notifications/schedulers/ETANotificationScheduler.ts index 4e4e732..ac63f5c 100644 --- a/src/notifications/schedulers/ETANotificationScheduler.ts +++ b/src/notifications/schedulers/ETANotificationScheduler.ts @@ -15,14 +15,10 @@ export interface ScheduledNotificationData { export class ETANotificationScheduler { public readonly secondsThresholdForNotificationToFire = 180; - private appleNotificationSender = new AppleNotificationSender() - - private _lastRefreshedTimeMs: number | undefined = undefined; - get lastRefreshedTimeMs() { - return this._lastRefreshedTimeMs; - } - - constructor(private repository: GetterRepository, private shouldActuallySendNotifications = true) { + constructor(private repository: GetterRepository, + private shouldActuallySendNotifications = true, + private appleNotificationSender = new AppleNotificationSender() + ) { this.etaSubscriberCallback = this.etaSubscriberCallback.bind(this); this.sendEtaNotificationImmediately = this.sendEtaNotificationImmediately.bind(this); this.etaSubscriberCallback = this.etaSubscriberCallback.bind(this);