diff --git a/packages/ui/src/apps/MobileApp.tsx b/packages/ui/src/apps/MobileApp.tsx index 24f82b31..9e2d2ecb 100644 --- a/packages/ui/src/apps/MobileApp.tsx +++ b/packages/ui/src/apps/MobileApp.tsx @@ -2345,7 +2345,11 @@ export function MobileApp({ apis }: MobileAppProps) { }, [clearError, error]); React.useEffect(() => { - if (!isNativeMobileApp || isConnected || !getRuntimeApiBaseUrl()) { + // Native: only while an instance is selected and reconnecting. Browser: the + // runtime is same-origin (no explicit base URL), so any not-connected spell + // counts — the splash holds until this fires, then the error screen shows. + const waitingOnConnection = !isConnected && (isNativeMobileApp ? Boolean(getRuntimeApiBaseUrl()) : true); + if (!waitingOnConnection) { setShowConnectionRecovery(false); return; } @@ -2383,7 +2387,7 @@ export function MobileApp({ apis }: MobileAppProps) { if (!fontsReady) { return (
- +
); } @@ -2395,7 +2399,7 @@ export function MobileApp({ apis }: MobileAppProps) { return (
- + {showConnectionRecovery ? ( <>
@@ -2424,7 +2428,7 @@ export function MobileApp({ apis }: MobileAppProps) { if (autoConnectPhase !== 'done') { return (
- +
); } @@ -2432,6 +2436,16 @@ export function MobileApp({ apis }: MobileAppProps) { } if (!isConnected && !isReconnecting) { + // Browser: the initial connect takes a beat — hold the logo splash instead + // of flashing the unreachable-server error while it resolves. The error + // only shows once the recovery delay has expired (genuinely unreachable). + if (!showConnectionRecovery) { + return ( +
+ +
+ ); + } return (