In the previous code , currentTopLevelDestination would be momentarily null.

pull/1684/head
AhmedTalib 11 months ago
parent ec0868cc02
commit 18fb916869

@ -89,8 +89,11 @@ class NiaAppState(
val currentTopLevelDestination: TopLevelDestination? val currentTopLevelDestination: TopLevelDestination?
@Composable get() { @Composable get() {
return TopLevelDestination.entries.firstOrNull { topLevelDestination -> val currentDestination = currentDestination
currentDestination?.hasRoute(route = topLevelDestination.route) ?: false return remember(currentDestination) {
TopLevelDestination.entries.firstOrNull { topLevelDestination ->
currentDestination?.hasRoute(route = topLevelDestination.route) ?: false
}
} }
} }

Loading…
Cancel
Save