From 12f5871f6f916e65534f1665d12f9b12b0f8f227 Mon Sep 17 00:00:00 2001 From: Hanzo_dev <2002samudiojohan@gmail.com> Date: Thu, 26 Feb 2026 09:22:38 -0500 Subject: [PATCH] fix(pwa): force service worker unregistration to distribute latest fixes --- frontend/src/main.ts | 9 +++++++++ frontend/src/views/SplashScreen.vue | 20 ++++++++++++++------ 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/frontend/src/main.ts b/frontend/src/main.ts index 1ec36cf..466f573 100644 --- a/frontend/src/main.ts +++ b/frontend/src/main.ts @@ -5,6 +5,15 @@ import i18n from './i18n' import './style.css' import App from './App.vue' +// Force unregister service workers to clear cache for now +if ('serviceWorker' in navigator) { + navigator.serviceWorker.getRegistrations().then((registrations) => { + for (const registration of registrations) { + registration.unregister(); + } + }); +} + const app = createApp(App) const pinia = createPinia() diff --git a/frontend/src/views/SplashScreen.vue b/frontend/src/views/SplashScreen.vue index eb4ce53..8d42b08 100644 --- a/frontend/src/views/SplashScreen.vue +++ b/frontend/src/views/SplashScreen.vue @@ -18,7 +18,7 @@

Transporte Público Boquete

-

Versión 2.0.0

+

Versión 2.0.1

@@ -48,7 +48,7 @@ onMounted(async () => { const initTimeout = setTimeout(() => { console.warn('Initialization taking too long, forcing navigation...') statusMessage.value = 'Iniciando de todas formas...' - navigate() + navigate(null, true) }, 3000) try { @@ -63,13 +63,21 @@ onMounted(async () => { } catch (error) { console.error('Initialization failed', error) clearTimeout(initTimeout) - navigate() + navigate(null, true) } }) -async function navigate(passedSession?: any) { - // Use passed session or fetch if missing - const session = passedSession || (await supabase.auth.getSession()).data.session +async function navigate(sessionData?: any, force = false) { + let session = sessionData; + + if (!session && !force) { + try { + const resp = await supabase.auth.getSession() + session = resp.data.session + } catch (e) { + console.warn('Silent auth check failed', e) + } + } if (!session) { router.replace('/map')