-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
♻️ Update Enable transition from session details to the search screen. #799
♻️ Update Enable transition from session details to the search screen. #799
Conversation
@@ -99,6 +100,10 @@ fun SearchRoot( | |||
|
|||
val keyboardController = LocalSoftwareKeyboardController.current | |||
|
|||
if (categoryId != null) { | |||
viewModel.onCategorySelected(categoryId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we shouldn't call viewModel moethod in Composable function directly. 👀
So how about using LaunchedEffect?
LaunchedEffect(initialCategoryId) {
viewModel.onCategorySelected(categoryId)
}
viewModel.onCategorySelected(categoryId) | ||
LaunchedEffect(categoryId) { | ||
if (categoryId != null) { | ||
viewModel.onCategorySelected(categoryId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, can we use initialCategoryId instead of categoryId? Because it is used only for the initial state.
Thanks! LGTM! |
Issue
Overview (Required)
Links
Movie
before.mp4
after.mp4