Skip to content

Commit 7685cc6

Browse files
committed
Apply suggestion
1 parent 3d72e9b commit 7685cc6

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

app/src/main/java/com/finoldigital/ygolp/presentation/MainActivity.kt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,9 +265,13 @@ class MainActivity : ComponentActivity() {
265265
navController = navController,
266266
startDestination = "lifepoints/1" // Start with player 1
267267
) {
268-
composable("lifepoints/{player}") { backStackEntry ->
269-
val player =
270-
backStackEntry.arguments?.getString("player")?.toIntOrNull() ?: 1
268+
composable(
269+
"lifepoints/{player}",
270+
arguments = listOf(
271+
navArgument("player") { type = NavType.IntType }
272+
)
273+
) { backStackEntry ->
274+
val player = backStackEntry.arguments?.getInt("player") ?: 1
271275
if (player == 1) {
272276
LifePointsScreen(
273277
displayedLifePoints = displayedLifePoints,

0 commit comments

Comments
 (0)