From 6576d40ae497c9dd490a91414dbaf0c34127e0be Mon Sep 17 00:00:00 2001 From: blurbery <271863866+blurbery@users.noreply.github.com> Date: Wed, 26 Aug 2026 17:23:58 +1000 Subject: [PATCH] perf(profiles): show Home before settings refresh --- iosApp/iosApp/ContentView.swift | 2 +- .../Screens/Profiles/ProfileSelectionViewModel.swift | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/iosApp/iosApp/ContentView.swift b/iosApp/iosApp/ContentView.swift index 3cd4c657..c605573c 100644 --- a/iosApp/iosApp/ContentView.swift +++ b/iosApp/iosApp/ContentView.swift @@ -887,8 +887,8 @@ struct ContentView: View { requiresPIN: profile.hasPin ) StartupContentPrefetcher.prefetchAuthenticatedContent() - await PlayerSettings.shared.refreshFromServer() router.resetToHome() + await PlayerSettings.shared.refreshFromServer() print("[DebugAutoLogin] signed in and selected profile") } catch { print("[DebugAutoLogin] failed: \(error)") diff --git a/iosApp/iosApp/Screens/Profiles/ProfileSelectionViewModel.swift b/iosApp/iosApp/Screens/Profiles/ProfileSelectionViewModel.swift index d6f74cd5..33d07a2a 100644 --- a/iosApp/iosApp/Screens/Profiles/ProfileSelectionViewModel.swift +++ b/iosApp/iosApp/Screens/Profiles/ProfileSelectionViewModel.swift @@ -59,8 +59,11 @@ class ProfileSelectionViewModel { requiresPIN: profile.hasPin ) StartupContentPrefetcher.prefetchAuthenticatedContent() - await PlayerSettings.shared.refreshFromServer() + // Change screens before the settings request suspends. The refresh + // applies this profile's cached playback quality synchronously, + // then updates it from the server while Home is already visible. router.resetToHome() + await PlayerSettings.shared.refreshFromServer() } catch { self.error = ErrorState(error) } @@ -77,8 +80,8 @@ class ProfileSelectionViewModel { requiresPIN: profile.hasPin ) StartupContentPrefetcher.prefetchAuthenticatedContent() - await PlayerSettings.shared.refreshFromServer() router.resetToHome() + await PlayerSettings.shared.refreshFromServer() } /// The picker itself has no active profile, but the server requires the