mirror of
https://github.com/greenart7c3/Amber.git
synced 2026-10-06 11:28:22 +00:00
Optimize AccountScreen recomposition
Move `intents` state collection into the `LoggedIn` state block to avoid unnecessary recompositions when the user is not logged in.
This commit is contained in:
@@ -53,7 +53,6 @@ fun AccountScreen(
|
||||
navController: NavHostController,
|
||||
) {
|
||||
val accountState by accountStateViewModel.accountContent.collectAsState()
|
||||
val intents by mainViewModel.intents.collectAsState(initial = emptyList())
|
||||
val context = LocalContext.current
|
||||
|
||||
Column {
|
||||
@@ -68,7 +67,8 @@ fun AccountScreen(
|
||||
MainLoginPage(accountStateViewModel, newNavController)
|
||||
}
|
||||
is AccountState.LoggedIn -> {
|
||||
LaunchedEffect(intent, intents) {
|
||||
val intents by mainViewModel.intents.collectAsState(initial = emptyList())
|
||||
LaunchedEffect(intent) {
|
||||
intent?.let {
|
||||
IntentUtils.getIntentData(
|
||||
context,
|
||||
|
||||
Reference in New Issue
Block a user