diff --git a/app/src/main/java/com/rtbishop/look4sat/MainScreen.kt b/app/src/main/java/com/rtbishop/look4sat/MainScreen.kt index 617bd39f..c337da5f 100644 --- a/app/src/main/java/com/rtbishop/look4sat/MainScreen.kt +++ b/app/src/main/java/com/rtbishop/look4sat/MainScreen.kt @@ -248,10 +248,15 @@ fun MainScreen( mapFilterViewModel = mapFilterViewModel, onMatchGrid = { grid -> // Grid-QSO dialog "Match" button: pre-fill the - // match page for that grid and switch to its tab. + // match page for that grid and open it. mutualViewModel.prefillMatchFromGrid(grid) - while (backStack.size > 1) backStack.removeAt(backStack.size - 1) - backStack.add(Screen.Mutual) + // Push Mutual on top of the Map entry instead of + // replacing the stack (bottom-nav style): the + // system back gesture then pops back to the map + // page, which is the page the user came from. + if (backStack.lastOrNull() !is Screen.Mutual) { + backStack.add(Screen.Mutual) + } } ) }