diff --git a/lib/screens/auth_screen.dart b/lib/screens/auth_screen.dart index 058c6517..ab4314a0 100644 --- a/lib/screens/auth_screen.dart +++ b/lib/screens/auth_screen.dart @@ -10,6 +10,7 @@ import '../services/server_registry.dart'; import '../services/server_connection_orchestrator.dart'; import '../providers/multi_server_provider.dart'; import '../providers/libraries_provider.dart'; +import '../providers/user_profile_provider.dart'; import '../services/offline_watch_sync_service.dart'; import '../i18n/strings.g.dart'; import '../theme/mono_tokens.dart'; @@ -83,6 +84,10 @@ class _AuthScreenState extends State { if (!mounted) return; + // Start profile initialization in parallel with server connection. + // The home users API (clients.plex.tv) is independent of server connections. + final profileFuture = context.read().initialize(); + final result = await ServerConnectionOrchestrator.connectAndInitialize( servers: servers, multiServerProvider: context.read(), @@ -98,6 +103,10 @@ class _AuthScreenState extends State { return; } + // Wait for profile init to finish before navigating so MainScreen + // has home user data available immediately. + await profileFuture; + if (!mounted) return; Navigator.pushReplacement( context,