From 813c125a0207bb3ac44655694c3e2028d05b5fd3 Mon Sep 17 00:00:00 2001 From: Alberto Espinoza Date: Fri, 22 Sep 2023 14:41:21 -0600 Subject: [PATCH] R2-2619 - Fix typo --- app/javascript/libs/service-worker-utils.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/javascript/libs/service-worker-utils.js b/app/javascript/libs/service-worker-utils.js index e02df432f2..469d5c52c7 100644 --- a/app/javascript/libs/service-worker-utils.js +++ b/app/javascript/libs/service-worker-utils.js @@ -4,8 +4,8 @@ import getToken from "../middleware/utils/get-token"; import DB, { DB_STORES } from "../db"; const SERVICE_WORKER_PATH = `${window.location.origin}/worker.js`; -const MAX_ATTEMPS = 3; -let attemps = 1; +const MAX_ATTEMPTS = 3; +let attempts = 1; async function getServiceWorker() { return navigator.serviceWorker.ready; @@ -67,18 +67,18 @@ async function sendSubscriptionStatusToServer(isSubscribing = true, data = {}) { } if (isSubscribing && response.status === 404) { - if (attemps % MAX_ATTEMPS !== 0) { + if (attempts % MAX_ATTEMPTS !== 0) { postMessage({ type: POST_MESSAGES.SUBSCRIBE_NOTIFICATIONS }); } - if (attemps % MAX_ATTEMPS === 0) { + if (attempts % MAX_ATTEMPTS === 0) { postMessage({ type: POST_MESSAGES.ATTEMPTS_SUBSCRIPTION_FAILED }); } - attemps += 1; + attempts += 1; } }