add optional dependency inject for apple notification sender

This commit is contained in:
2025-03-24 09:59:29 -07:00
parent 26cdab9907
commit a6ceeb4dfb

View File

@@ -15,14 +15,10 @@ export interface ScheduledNotificationData {
export class ETANotificationScheduler { export class ETANotificationScheduler {
public readonly secondsThresholdForNotificationToFire = 180; public readonly secondsThresholdForNotificationToFire = 180;
private appleNotificationSender = new AppleNotificationSender() constructor(private repository: GetterRepository,
private shouldActuallySendNotifications = true,
private _lastRefreshedTimeMs: number | undefined = undefined; private appleNotificationSender = new AppleNotificationSender()
get lastRefreshedTimeMs() { ) {
return this._lastRefreshedTimeMs;
}
constructor(private repository: GetterRepository, private shouldActuallySendNotifications = true) {
this.etaSubscriberCallback = this.etaSubscriberCallback.bind(this); this.etaSubscriberCallback = this.etaSubscriberCallback.bind(this);
this.sendEtaNotificationImmediately = this.sendEtaNotificationImmediately.bind(this); this.sendEtaNotificationImmediately = this.sendEtaNotificationImmediately.bind(this);
this.etaSubscriberCallback = this.etaSubscriberCallback.bind(this); this.etaSubscriberCallback = this.etaSubscriberCallback.bind(this);