In the previous code , currentTopLevelDestination would be momentarily null.

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

@ -89,10 +89,13 @@ class NiaAppState(
val currentTopLevelDestination: TopLevelDestination? val currentTopLevelDestination: TopLevelDestination?
@Composable get() { @Composable get() {
return TopLevelDestination.entries.firstOrNull { topLevelDestination -> val currentDestination = currentDestination
return remember(currentDestination) {
TopLevelDestination.entries.firstOrNull { topLevelDestination ->
currentDestination?.hasRoute(route = topLevelDestination.route) ?: false currentDestination?.hasRoute(route = topLevelDestination.route) ?: false
} }
} }
}
val isOffline = networkMonitor.isOnline val isOffline = networkMonitor.isOnline
.map(Boolean::not) .map(Boolean::not)

Loading…
Cancel
Save