extract seconds number to public readonly class property

This commit is contained in:
2025-02-03 23:15:05 -08:00
parent 11ea0518fe
commit b3b4b71e22

View File

@@ -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;
} }