mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 16:00:32 +00:00
extract seconds number to public readonly class property
This commit is contained in:
@@ -11,6 +11,8 @@ export interface ScheduledNotificationData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class NotificationService {
|
export class NotificationService {
|
||||||
|
public readonly secondsThresholdForNotificationToFire = 300;
|
||||||
|
|
||||||
private apnsToken: string | undefined = undefined;
|
private apnsToken: string | undefined = undefined;
|
||||||
|
|
||||||
private _lastRefreshedTimeMs: number | undefined = undefined;
|
private _lastRefreshedTimeMs: number | undefined = undefined;
|
||||||
@@ -156,8 +158,7 @@ export class NotificationService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async sendEtaNotificationImmediatelyIfSecondsRemainingBelowThreshold(deviceId: string, eta: IEta) {
|
private async sendEtaNotificationImmediatelyIfSecondsRemainingBelowThreshold(deviceId: string, eta: IEta) {
|
||||||
const secondsThresholdForNotificationToFire = 300;
|
if (eta.secondsRemaining > this.secondsThresholdForNotificationToFire) {
|
||||||
if (eta.secondsRemaining > secondsThresholdForNotificationToFire) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user