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
This commit is contained in:
MrPiglr 2026-02-12 15:31:35 -07:00
parent 526bfc0438
commit 94044be8d1

View file

@ -64,16 +64,15 @@ export function detectPlatform(): PlatformType {
return cachedPlatform; return cachedPlatform;
} }
// Fallback: Check for Android/iOS in User Agent if Capacitor isn't ready yet // 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
if (userAgent.includes('android') || userAgent.includes('iphone') || userAgent.includes('ipad') || userAgent.includes('vortex')) { // Uncomment the lines below ONLY if you need mobile web browser detection:
console.log('[Platform] Detected: mobile (UA override)', userAgent); // if (userAgent.includes('android') || userAgent.includes('iphone') || userAgent.includes('ipad')) {
// We don't cache this as 'mobile' permanently yet in case it's just a mobile browser, // console.log('[Platform] Detected: mobile (UA)', userAgent);
// but for this specific hybrid app, treating it as mobile is safer. // return 'mobile';
return 'mobile'; // }
}
// Default to web, but do NOT cache it so we can re-check later when Capacitor might be ready // 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'; return 'web';
} }