From 94044be8d12d63b024afb476e75c73e123bbe574 Mon Sep 17 00:00:00 2001 From: MrPiglr Date: Thu, 12 Feb 2026 15:31:35 -0700 Subject: [PATCH] fix(platform): disable aggressive mobile detection for web browsers - Comment out user agent-based mobile detection - Only detect mobile when native bridges present (Capacitor/Flutter/Cordova) - Fixes web browsers showing mobile UI instead of desktop OS - Users on aethex.app will now see desktop interface Desktop browsers should show desktop OS, not mobile app UI --- client/src/lib/platform.ts | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/client/src/lib/platform.ts b/client/src/lib/platform.ts index 62d136d..f5b18b5 100644 --- a/client/src/lib/platform.ts +++ b/client/src/lib/platform.ts @@ -64,16 +64,15 @@ export function detectPlatform(): PlatformType { return cachedPlatform; } - // Fallback: Check for Android/iOS in User Agent if Capacitor isn't ready yet - if (userAgent.includes('android') || userAgent.includes('iphone') || userAgent.includes('ipad') || userAgent.includes('vortex')) { - console.log('[Platform] Detected: mobile (UA override)', userAgent); - // We don't cache this as 'mobile' permanently yet in case it's just a mobile browser, - // but for this specific hybrid app, treating it as mobile is safer. - return 'mobile'; - } - + // Only treat as mobile if we're actually in a native app context // Don't rely on user agent alone since users browsing from desktop should see desktop UI + // Uncomment the lines below ONLY if you need mobile web browser detection: + // if (userAgent.includes('android') || userAgent.includes('iphone') || userAgent.includes('ipad')) { + // console.log('[Platform] Detected: mobile (UA)', userAgent); + // return 'mobile'; + // } + // Default to web, but do NOT cache it so we can re-check later when Capacitor might be ready - console.log('[Platform] Detected: web (default check)'); + console.log('[Platform] Detected: web (default - desktop browser or no native bridge)'); return 'web'; }