Fix: Usar pointer device para detectar desktop en lugar de ancho
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 56s

- Cambiar detección de desktop de min-width a (pointer: fine)
- Esto detecta si tiene mouse/trackpad (desktop) vs touch (móvil)
- Más confiable para PWAs que se abren con ancho fijo
- Mantener ancho como fallback para compatibilidad
This commit is contained in:
2025-10-17 05:13:00 -06:00
parent d08bd81c73
commit 305143b433
2 changed files with 33 additions and 15 deletions

View File

@@ -11,8 +11,10 @@ export default defineNuxtPlugin(() => {
window.matchMedia('(display-mode: window-controls-overlay)').matches ||
(window.navigator as any).standalone === true
// Detectar si estamos en desktop
const isDesktop = window.matchMedia('(min-width: 1024px)').matches
// Detectar si estamos en desktop usando pointer device (más confiable para PWAs)
const pointerQuery = window.matchMedia('(pointer: fine)')
const widthQuery = window.matchMedia('(min-width: 1024px)')
const isDesktop = pointerQuery.matches || widthQuery.matches
if (isPWA) {
// Obtener el origin de la aplicación