mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 07:50:31 +00:00
move shouldSendNotifications property to the AppleNotificationSender
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
import { GetterRepository } from "../../repositories/GetterRepository";
|
||||
import jwt from "jsonwebtoken";
|
||||
import fs from "fs";
|
||||
import { TupleKey } from "../../types/TupleKey";
|
||||
import { IEta } from "../../entities/entities";
|
||||
import http2 from "http2";
|
||||
import { AppleNotificationSender, NotificationAlertArguments } from "../senders/AppleNotificationSender";
|
||||
|
||||
export interface ScheduledNotificationData {
|
||||
@@ -16,7 +13,6 @@ export class ETANotificationScheduler {
|
||||
public readonly secondsThresholdForNotificationToFire = 180;
|
||||
|
||||
constructor(private repository: GetterRepository,
|
||||
private shouldActuallySendNotifications = true,
|
||||
private appleNotificationSender = new AppleNotificationSender()
|
||||
) {
|
||||
this.etaSubscriberCallback = this.etaSubscriberCallback.bind(this);
|
||||
@@ -35,10 +31,6 @@ export class ETANotificationScheduler {
|
||||
private deviceIdsToDeliverTo: { [key: string]: Set<string> } = {}
|
||||
|
||||
private async sendEtaNotificationImmediately(notificationData: ScheduledNotificationData): Promise<boolean> {
|
||||
if (!this.shouldActuallySendNotifications) {
|
||||
return true; // pretend that the notification sent
|
||||
}
|
||||
|
||||
const { deviceId, shuttleId, stopId } = notificationData;
|
||||
|
||||
const shuttle = await this.repository.getShuttleById(shuttleId);
|
||||
|
||||
Reference in New Issue
Block a user