rename token variable for clarity

This commit is contained in:
2025-02-03 21:57:42 -08:00
parent 339148c890
commit 18402401e3

View File

@@ -12,7 +12,7 @@ interface ScheduledNotificationData {
}
export class NotificationService {
private token: string | undefined = undefined;
private apnsToken: string | undefined = undefined;
private _lastRefreshedTimeMs: number | undefined = undefined;
get lastRefreshedTimeMs() {
@@ -53,7 +53,7 @@ export class NotificationService {
"iat": now,
};
this.token = jwt.sign(claimsPayload, privateKey, {
this.apnsToken = jwt.sign(claimsPayload, privateKey, {
algorithm: "ES256",
header: tokenHeader
});
@@ -66,6 +66,8 @@ export class NotificationService {
}
private async sendEtaNotificationImmediately({ deviceId, shuttleId, stopId }: ScheduledNotificationData): Promise<boolean> {
this.reloadAPNsTokenIfTimePassed();
// Construct the fetch request
// Send the fetch request