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