Skip to content

Commit

Permalink
✨ MainActivity.kt: if there is a single learning package, load it
Browse files Browse the repository at this point in the history
  • Loading branch information
O-O-Balance authored and berlix committed Feb 17, 2024
1 parent 3f49314 commit f89d4fa
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ class MainActivity : ComponentActivity() {
val learningApps =
learningAppViewModel.getLearningApps().observeAsState(listOf())

val learningApp = learningApps.value.singleOrNull()
LaunchedEffect(learningApps.value) {
learningApp?.let { navController.navigate("learning-apps/${it.packageName}/units") }
}

LearningAppsScreen(
learningApps.value,
learningAppViewModel.importStatus,
Expand Down

0 comments on commit f89d4fa

Please sign in to comment.