Fix navigator to ensure we don't end up with a weird backstack.

This commit is contained in:
Alex Hart
2025-09-12 11:04:48 -03:00
committed by Greyson Parrelli
parent bf3135b2d0
commit 53a6b0c719
2 changed files with 27 additions and 2 deletions

View File

@@ -347,13 +347,17 @@ class MainActivity : PassphraseRequiredActivity(), VoiceNoteMediaControllerOwner
val mutableInteractionSource = remember { MutableInteractionSource() }
LaunchedEffect(mainNavigationDetailLocation) {
println("Detail Location Changed pane:${wrappedNavigator.currentDestination?.pane}")
if (paneExpansionState.currentAnchor == listOnlyAnchor && wrappedNavigator.currentDestination?.pane == ThreePaneScaffoldRole.Primary) {
println("Animate detail")
paneExpansionState.animateTo(detailOnlyAnchor)
}
}
LaunchedEffect(mainNavigationState.currentListLocation) {
println("List Location Changed pane:${wrappedNavigator.currentDestination?.pane}")
if (paneExpansionState.currentAnchor == detailOnlyAnchor && wrappedNavigator.currentDestination?.pane == ThreePaneScaffoldRole.Secondary) {
println("Animate list")
paneExpansionState.animateTo(listOnlyAnchor)
}
}