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:
greenart7c3
2025-12-18 13:07:12 -03:00
parent fff11b061b
commit 7e1e1acedf
@@ -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,