From 33a7d9aeb2e25376629da8207f8825fc2d25e526 Mon Sep 17 00:00:00 2001 From: ernstmul Date: Wed, 13 Nov 2024 13:33:28 +0100 Subject: [PATCH] Change regex to string comparison --- src/service-worker.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/service-worker.ts b/src/service-worker.ts index 5d2267fbc..eae3992e7 100644 --- a/src/service-worker.ts +++ b/src/service-worker.ts @@ -3,7 +3,7 @@ /// /// -import { build, files, version } from '$service-worker'; +import { build, files, version, base } from '$service-worker'; const sw = self as unknown as ServiceWorkerGlobalScope; @@ -23,7 +23,7 @@ sw.addEventListener('install', (event) => { } // Check if the page URL does not match the exclusion path - const shouldCache = !/\/console\/auth\/oauth2\/.*/.test(location.pathname); + const shouldCache = !base.startsWith('/console/auth'); if (shouldCache) { event.waitUntil(addFilesToCache()); }