From d08bd81c733935310e1177658d82d30259d3536c Mon Sep 17 00:00:00 2001 From: josedario87 Date: Fri, 17 Oct 2025 05:06:47 -0600 Subject: [PATCH] Debug: Agregar logs para detectar problema con target='_blank' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Agregar logs en useDeviceType para ver detección de desktop - Agregar logs en shouldOpenInNewTab para ver resultado - Esto ayudará a diagnosticar por qué no se abren nuevas ventanas --- nuxt4/app/components/auth/ApplicationsList.vue | 9 ++++++++- nuxt4/app/composables/useDeviceType.ts | 10 ++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/nuxt4/app/components/auth/ApplicationsList.vue b/nuxt4/app/components/auth/ApplicationsList.vue index 4feca72..77b4c4e 100644 --- a/nuxt4/app/components/auth/ApplicationsList.vue +++ b/nuxt4/app/components/auth/ApplicationsList.vue @@ -311,7 +311,14 @@ const refreshInterval = setInterval(() => { // En desktop, siempre abrir en nueva ventana para lanzar PWAs // En móvil, respetar la configuración de la app const shouldOpenInNewTab = (app: Application): boolean => { - return isDesktop.value || app.openInNewTab + const result = isDesktop.value || app.openInNewTab + console.log('[ApplicationsList] shouldOpenInNewTab:', { + appName: app.name, + isDesktop: isDesktop.value, + appOpenInNewTab: app.openInNewTab, + result + }) + return result } // Limpiar interval cuando el componente se desmonte diff --git a/nuxt4/app/composables/useDeviceType.ts b/nuxt4/app/composables/useDeviceType.ts index 9659797..8f948ce 100644 --- a/nuxt4/app/composables/useDeviceType.ts +++ b/nuxt4/app/composables/useDeviceType.ts @@ -13,9 +13,19 @@ export const useDeviceType = () => { // Establecer valor inicial isDesktop.value = mediaQuery.matches + console.log('[useDeviceType] Initialized:', { + isDesktop: isDesktop.value, + windowWidth: window.innerWidth, + mediaQueryMatches: mediaQuery.matches + }) + // Escuchar cambios en el tamaño de pantalla const handleChange = (e: MediaQueryListEvent) => { isDesktop.value = e.matches + console.log('[useDeviceType] Changed:', { + isDesktop: isDesktop.value, + windowWidth: window.innerWidth + }) } mediaQuery.addEventListener('change', handleChange)