mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-26 00:56:34 +02:00
Avoiding calculations in the UI thread
This commit is contained in:
@@ -50,9 +50,11 @@ class RelayFeedViewModel: ViewModel() {
|
|||||||
}
|
}
|
||||||
} ?: emptyList()
|
} ?: emptyList()
|
||||||
|
|
||||||
|
val newList = (beingUsed + newRelaysFromRecord).sortedWith(order)
|
||||||
|
|
||||||
viewModelScope.launch {
|
viewModelScope.launch {
|
||||||
withContext(Dispatchers.Main) {
|
withContext(Dispatchers.Main) {
|
||||||
_feedContent.update { (beingUsed + newRelaysFromRecord).sortedWith(order) }
|
_feedContent.update { newList }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user