Just use remember{} instead of adding derivedStateOf{} to avoid weird state issues.

This commit is contained in:
KotlinGeekDev
2025-09-26 16:21:13 +01:00
parent 61459187d7
commit d2d811f670
@@ -23,7 +23,6 @@ package com.vitorpamplona.amethyst.service.relayClient.reqCommand.user
import android.annotation.SuppressLint
import androidx.compose.runtime.Composable
import androidx.compose.runtime.State
import androidx.compose.runtime.derivedStateOf
import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
import androidx.lifecycle.compose.collectAsStateWithLifecycle
@@ -413,9 +412,10 @@ fun observeUserIsFollowing(
): State<Boolean> {
// Subscribe in the relay for changes in the metadata of this user.
UserFinderFilterAssemblerSubscription(user1, accountViewModel)
val isUserInFollowSets by remember(accountViewModel.account.followSetsState) {
derivedStateOf { accountViewModel.account.followSetsState.isUserInFollowSets(user2) }
}
val isUserInFollowSets =
remember(accountViewModel.account.followSetsState) {
accountViewModel.account.followSetsState.isUserInFollowSets(user2)
}
// Subscribe in the LocalCache for changes that arrive in the device
val flow =