Skip to content

Commit

Permalink
Merge pull request #61 from Team-Notitime/fix/60-navigation-issue
Browse files Browse the repository at this point in the history
fix: 네비게이션 백스택 쌓이는 이슈 수정 #60
  • Loading branch information
easyhz authored Aug 12, 2024
2 parents 7028f16 + c457fd6 commit e2487b0
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.util.trace
import androidx.navigation.NavDestination
import androidx.navigation.NavGraph.Companion.findStartDestination
import androidx.navigation.NavHostController
import androidx.navigation.compose.currentBackStackEntryAsState
import androidx.navigation.compose.rememberNavController
Expand All @@ -18,7 +17,7 @@ import com.easyhz.noffice.navigation.util.BottomMenuTabs

@Composable
internal fun rememberNofficeNavController(navController: NavHostController = rememberNavController()) =
remember(navController) { NofficeNavController(navController = navController) }
remember { NofficeNavController(navController = navController) }

internal class NofficeNavController(
val navController: NavHostController
Expand Down Expand Up @@ -49,8 +48,9 @@ internal class NofficeNavController(
if (route.qualifierName == navController.currentDestination?.route) return
trace("Navigation: ${route.name}") {
val navOptions = navOptions {
popUpTo(navController.graph.findStartDestination().id) {
popUpTo(navController.graph.id) {
saveState = true
inclusive = true
}
launchSingleTop = true
restoreState = true
Expand Down

0 comments on commit e2487b0

Please sign in to comment.