From cae70e16e29e3bd272ffbd206bfd8fc5b6cd3197 Mon Sep 17 00:00:00 2001 From: Shepherd Date: Mon, 16 Sep 2024 11:38:24 -0400 Subject: [PATCH] Use helper method to simplify code --- src/core/CoreModuleDirector.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/CoreModuleDirector.ts b/src/core/CoreModuleDirector.ts index 8b2abc374..9cf8dae70 100644 --- a/src/core/CoreModuleDirector.ts +++ b/src/core/CoreModuleDirector.ts @@ -277,9 +277,9 @@ export class CoreModuleDirector { ); const { lastKnownPushToken } = await Database.getAppState(); if (lastKnownPushToken) { - const pushSubscriptions = this.getAllPushSubscriptionModels(); - return Object.values(pushSubscriptions).find( - (subscription) => subscription.data.token === lastKnownPushToken, + return this.getSubscriptionOfTypeWithToken( + ModelName.Subscriptions, + lastKnownPushToken, ); } return undefined;