Add fixes for primary choice when returning to chats.

This commit is contained in:
Alex Hart
2025-09-12 11:12:41 -03:00
committed by Greyson Parrelli
parent 53a6b0c719
commit 23b7ea90a1

View File

@@ -184,6 +184,11 @@ class MainNavigationViewModel(
navigatorScope?.launch {
val currentPane = navigator?.currentDestination?.pane ?: return@launch
if (currentPane == ThreePaneScaffoldRole.Secondary) {
val multiPane = navigator?.scaffoldDirective?.maxHorizontalPartitions == 2
if (multiPane && location == MainNavigationListLocation.CHATS && latestConversationLocation != null) {
navigator?.navigateTo(ThreePaneScaffoldRole.Primary)
}
return@launch
} else {
navigator?.navigateBack()