Skip to content

Commit

Permalink
Merge pull request #132 from Shashank02051997/master
Browse files Browse the repository at this point in the history
Stop recomposing QuotesListScreen twice
  • Loading branch information
Spikeysanju authored Jan 4, 2022
2 parents 31ebaf0 + 6be1eab commit b9f1e3d
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ fun NavGraph(toggleTheme: () -> Unit) {
AnimatedNavHost(navController, startDestination = Screen.Home.route) {
// Quotes List
composable(Screen.Home.route) {
val viewModel: MainViewModel = viewModel(
factory = HiltViewModelFactory(LocalContext.current, it)
)
val viewModel = hiltViewModel<MainViewModel>(it)
QuotesListScreen(viewModel, toggleTheme, actions)
}

Expand Down

0 comments on commit b9f1e3d

Please sign in to comment.