kopia lustrzana https://github.com/vitorpamplona/amethyst
Avoiding calculations in the UI thread
rodzic
4303e6040c
commit
94a4bfc2f3
|
@ -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 }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue