From 8d8016e01bbe42a86a9e760edbc3407b9488d80f Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Wed, 21 Aug 2024 15:51:01 -0400 Subject: [PATCH] Simplifies nav bar selected calculations --- .../amethyst/ui/navigation/AppBottomBar.kt | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/navigation/AppBottomBar.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/navigation/AppBottomBar.kt index 406eb997d..8210cdbb1 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/navigation/AppBottomBar.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/navigation/AppBottomBar.kt @@ -158,12 +158,10 @@ private fun RowScope.HasNewItemsIcon( nav: (Route, Boolean) -> Unit, ) { val selected = - ( - navEntryState.value - ?.destination - ?.route - ?.indexOf(route.base) ?: -1 - ) > -1 + navEntryState.value + ?.destination + ?.route + ?.startsWith(route.base) ?: false NavigationBarItem( alwaysShowLabel = false,