From ec70c9ab565b5ce5b69280d0606e446bf964e474 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Sun, 25 May 2025 16:53:09 +0530 Subject: [PATCH] fix: try fixing backstack introspection --- .../dev/msfjarvis/claw/android/ui/screens/Nav3Screen.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/android/src/main/kotlin/dev/msfjarvis/claw/android/ui/screens/Nav3Screen.kt b/android/src/main/kotlin/dev/msfjarvis/claw/android/ui/screens/Nav3Screen.kt index 2c4da875..4f509928 100644 --- a/android/src/main/kotlin/dev/msfjarvis/claw/android/ui/screens/Nav3Screen.kt +++ b/android/src/main/kotlin/dev/msfjarvis/claw/android/ui/screens/Nav3Screen.kt @@ -136,7 +136,7 @@ fun Nav3Screen( TopAppBar( modifier = Modifier.shadow(8.dp), navigationIcon = { - if (backStack.none { it in navDestinations }) { + if (backStack.firstOrNull() !in navDestinations) { IconButton(onClick = { if (backStack.removeLastOrNull() == null) activity?.finish() }) { Icon( imageVector = Icons.AutoMirrored.Filled.ArrowBack, @@ -152,12 +152,12 @@ fun Nav3Screen( } }, title = { - if (backStack.any { it in navDestinations }) { + if (backStack.firstOrNull() in navDestinations) { Text(text = stringResource(R.string.app_name), fontWeight = FontWeight.Bold) } }, actions = { - if (backStack.any { it in navDestinations }) { + if (backStack.firstOrNull() in navDestinations) { IconButton(onClick = { backStack.add(Search) }) { Icon(imageVector = Icons.Filled.Search, contentDescription = "Search posts") } @@ -173,7 +173,7 @@ fun Nav3Screen( ClawNavigationBar( backStack, items = navItems, - isVisible = backStack.any { it in navDestinations }, + isVisible = backStack.firstOrNull() in navDestinations, hazeState = hazeState, ) }