diff --git a/packages/messaging/src/api/getToken.ts b/packages/messaging/src/api/getToken.ts index cb7cc37a51c..58c9fea90c4 100644 --- a/packages/messaging/src/api/getToken.ts +++ b/packages/messaging/src/api/getToken.ts @@ -40,10 +40,7 @@ export async function getToken( } await updateVapidKey(messaging, options?.vapidKey); - await updateSwReg( - messaging, - options?.serviceWorkerRegistration - ); + await updateSwReg(messaging, options?.serviceWorkerRegistration); return getTokenInternal(messaging); } diff --git a/packages/messaging/src/helpers/registerDefaultSw.ts b/packages/messaging/src/helpers/registerDefaultSw.ts index a32173e27e8..28890c93bd2 100644 --- a/packages/messaging/src/helpers/registerDefaultSw.ts +++ b/packages/messaging/src/helpers/registerDefaultSw.ts @@ -43,9 +43,7 @@ export async function registerDefaultSw( messaging.swRegistration.update().catch(() => { /* it is non blocking and we don't care if it failed */ }); - await waitForRegistrationActive( - messaging.swRegistration - ); + await waitForRegistrationActive(messaging.swRegistration); } catch (e) { throw ERROR_FACTORY.create(ErrorCode.FAILED_DEFAULT_REGISTRATION, { browserErrorMessage: (e as Error)?.message