mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 07:50:31 +00:00
add a public method to get the seconds threshold for a scheduled notification
This commit is contained in:
@@ -147,16 +147,17 @@ export class ETANotificationScheduler {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Check whether the notification is scheduled.
|
* Check whether the notification is scheduled.
|
||||||
* @param deviceId
|
|
||||||
* @param shuttleId
|
|
||||||
* @param stopId
|
|
||||||
*/
|
*/
|
||||||
public isNotificationScheduled({ deviceId, shuttleId, stopId }: NotificationLookupArguments): boolean {
|
public isNotificationScheduled(lookupArguments: NotificationLookupArguments): boolean {
|
||||||
|
return this.getSecondsThresholdForScheduledNotification(lookupArguments) != null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public getSecondsThresholdForScheduledNotification({ deviceId, shuttleId, stopId }: NotificationLookupArguments): number | null {
|
||||||
const tuple = new TupleKey(shuttleId, stopId);
|
const tuple = new TupleKey(shuttleId, stopId);
|
||||||
if (this.deviceIdsToDeliverTo[tuple.toString()] === undefined) {
|
if (this.deviceIdsToDeliverTo[tuple.toString()] === undefined) {
|
||||||
return false;
|
return null;
|
||||||
}
|
}
|
||||||
return deviceId in this.deviceIdsToDeliverTo[tuple.toString()];
|
return this.deviceIdsToDeliverTo[tuple.toString()][deviceId];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user