Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,15 @@ fun ProfileSelectionScreen(
}
}

// Navigate when activeProfile changes after user selection
LaunchedEffect(uiState.activeProfile?.id, uiState.isSwitchingProfile) {
// Navigate after the user picks a profile.
// `navigateTriggered` MUST be a key. Keying only on the uiState values meant the tap itself
// never re-evaluated this, so navigation depended on *observing* a change in one of them —
// and re-selecting the already-active profile changes neither: activeProfile.id stays put,
// and isSwitchingProfile goes true→false inside a single frame, which the StateFlow conflates
// away before Compose ever reads it. The effect then never restarted and the tap did nothing,
// until some unrelated hitch let a frame land mid-switch. (Re-selecting the active profile
// became fast enough to hit this when d9e49b10 dropped its setActiveProfile disk write.)
LaunchedEffect(navigateTriggered, uiState.activeProfile?.id, uiState.isSwitchingProfile) {
if (
navigateTriggered &&
uiState.activeProfile != null &&
Expand Down
Loading