mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-03-26 17:52:29 +01:00
Avoiding calculations in the UI thread
This commit is contained in:
parent
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 }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user