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'; }