Avoiding calculations in the UI thread

pull/63/head
Vitor Pamplona 2023-01-31 22:11:54 -03:00
rodzic 4303e6040c
commit 94a4bfc2f3
1 zmienionych plików z 3 dodań i 1 usunięć

Wyświetl plik

@ -50,9 +50,11 @@ class RelayFeedViewModel: ViewModel() {
}
} ?: emptyList()
val newList = (beingUsed + newRelaysFromRecord).sortedWith(order)
viewModelScope.launch {
withContext(Dispatchers.Main) {
_feedContent.update { (beingUsed + newRelaysFromRecord).sortedWith(order) }
_feedContent.update { newList }
}
}
}