Skip to content

Commit

Permalink
Loading reply from launch and not withContent
Browse files Browse the repository at this point in the history
  • Loading branch information
vitorpamplona committed May 28, 2023
1 parent 1c381f6 commit 6bc1b6b
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -19,14 +19,14 @@ import com.vitorpamplona.amethyst.R
import com.vitorpamplona.amethyst.model.*
import com.vitorpamplona.amethyst.ui.components.CreateClickableTextWithEmoji
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import kotlinx.coroutines.launch

@Composable
fun ReplyInformation(replyTo: List<Note>?, mentions: List<String>, account: Account, nav: (String) -> Unit) {
var dupMentions by remember { mutableStateOf<List<User>?>(null) }

LaunchedEffect(Unit) {
withContext(Dispatchers.IO) {
launch(Dispatchers.IO) {
dupMentions = mentions.mapNotNull { LocalCache.checkGetOrCreateUser(it) }
}
}
Expand Down Expand Up @@ -119,7 +119,7 @@ fun ReplyInformationChannel(replyTo: List<Note>?, mentions: List<String>, channe
var sortedMentions by remember { mutableStateOf<List<User>?>(null) }

LaunchedEffect(Unit) {
withContext(Dispatchers.IO) {
launch(Dispatchers.IO) {
sortedMentions = mentions
.mapNotNull { LocalCache.checkGetOrCreateUser(it) }
.toSet()
Expand Down

0 comments on commit 6bc1b6b

Please sign in to comment.