add getter to lastRefreshedTimeMs

This commit is contained in:
2025-02-02 14:44:35 -08:00
parent ddf008a0d6
commit 9129ff6e91

View File

@@ -11,7 +11,11 @@ interface ScheduledNotificationData {
export class NotificationService { export class NotificationService {
private token: string | undefined = undefined; private token: string | undefined = undefined;
private lastRefreshedTimeMs: number | undefined = undefined;
private _lastRefreshedTimeMs: number | undefined = undefined;
get lastRefreshedTimeMs() {
return this._lastRefreshedTimeMs;
}
constructor(private repository: GetterRepository) {} constructor(private repository: GetterRepository) {}
@@ -47,7 +51,7 @@ export class NotificationService {
private lastReloadedTimeForAPNsIsTooRecent() { private lastReloadedTimeForAPNsIsTooRecent() {
const thirtyMinutesMs = 1800000; const thirtyMinutesMs = 1800000;
return this.lastRefreshedTimeMs && Date.now() - this.lastRefreshedTimeMs < thirtyMinutesMs; return this._lastRefreshedTimeMs && Date.now() - this._lastRefreshedTimeMs < thirtyMinutesMs;
} }
public async scheduleNotification({ deviceId, shuttleId, stopId }: ScheduledNotificationData) { public async scheduleNotification({ deviceId, shuttleId, stopId }: ScheduledNotificationData) {