mirror of
https://github.com/AeThex-Corporation/AeThex-OS.git
synced 2026-04-17 22:27:19 +00:00
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:
parent
526bfc0438
commit
94044be8d1
1 changed files with 8 additions and 9 deletions
|
|
@ -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';
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue