Skip to content

Commit

Permalink
use koin context
Browse files Browse the repository at this point in the history
  • Loading branch information
softartdev committed Nov 12, 2024
1 parent 0cace9c commit 2c5c982
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import com.softartdev.notedelight.ui.dialog.security.EnterPasswordDialog
import com.softartdev.theme.material3.PreferableMaterialTheme
import com.softartdev.theme.material3.ThemeDialog
import com.softartdev.theme.pref.PreferenceHelper
import org.koin.compose.KoinContext
import org.koin.compose.viewmodel.koinNavViewModel
import org.koin.compose.viewmodel.koinViewModel
import org.koin.core.annotation.KoinExperimentalAPI
Expand All @@ -39,6 +40,14 @@ import org.koin.core.parameter.parametersOf
fun App(
router: Router,
navController: NavHostController = rememberNavController()
) = KoinContext {
WrappedApp(router, navController)
}

@Composable
private fun WrappedApp(
router: Router,
navController: NavHostController = rememberNavController()
) = PreferableMaterialTheme {
DisposableEffect(key1 = router, key2 = navController) {
router.setController(navController)
Expand Down

0 comments on commit 2c5c982

Please sign in to comment.