mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-19 16:51:08 +02:00
Avoiding calculations in the UI thread
This commit is contained in:
@@ -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 }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user