mirror of
https://github.com/AeThex-Corporation/AeThex-OS.git
synced 2026-04-17 22:27:19 +00:00
modified: client/src/main.tsx
This commit is contained in:
parent
afb0b13ef6
commit
cc1688110c
2 changed files with 20 additions and 22 deletions
|
|
@ -36,19 +36,19 @@ export function detectPlatform(): PlatformType {
|
|||
return cachedPlatform;
|
||||
}
|
||||
|
||||
// Capacitor check - sometimes injected late, so don't cache 'web' result immediately
|
||||
// IMPORTANT: Capacitor has a web implementation that creates window.Capacitor
|
||||
// We need to check if we're in a REAL native app, not just the web polyfill
|
||||
// Capacitor check - only detect mobile on actual native platforms
|
||||
if (window.Capacitor !== undefined) {
|
||||
// Check if we're actually in a native app by checking for native platform
|
||||
const isRealNative = (window.Capacitor as any)?.getPlatform &&
|
||||
(window.Capacitor as any).getPlatform() !== 'web';
|
||||
if (isRealNative) {
|
||||
console.log('[Platform] Detected: mobile (Capacitor native)');
|
||||
try {
|
||||
// Capacitor has getPlatform() that returns 'android', 'ios', or 'web'
|
||||
const capacitorPlatform = (window.Capacitor as any).getPlatform?.();
|
||||
if (capacitorPlatform === 'android' || capacitorPlatform === 'ios') {
|
||||
console.log('[Platform] Detected: mobile (Capacitor on ' + capacitorPlatform + ')');
|
||||
cachedPlatform = 'mobile';
|
||||
return cachedPlatform;
|
||||
} else {
|
||||
console.log('[Platform] Capacitor detected but running on web - treating as web');
|
||||
}
|
||||
console.log('[Platform] Capacitor running on web platform - ignoring');
|
||||
} catch (e) {
|
||||
console.log('[Platform] Capacitor check failed - treating as web');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ const LoadingScreen = () => (
|
|||
<div style={{
|
||||
height: '100vh',
|
||||
width: '100vw',
|
||||
backgroundColor: 'blue',
|
||||
backgroundColor: '#0a0a0a',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
|
|
@ -27,8 +27,6 @@ const LoadingScreen = () => (
|
|||
|
||||
const renderApp = () => {
|
||||
console.log('[AeThexOS] Starting RenderApp...');
|
||||
// Immediate visual feedback that JS is executing
|
||||
document.body.style.backgroundColor = 'purple';
|
||||
|
||||
const rootElement = document.getElementById("root");
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue