mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-10-04 21:57:00 +02:00
Puts an invalidate data on an IO thread
This commit is contained in:
@@ -292,12 +292,14 @@ abstract class FeedViewModel(val localFilter: FeedFilter<Note>) : ViewModel(), I
|
|||||||
private val bundlerInsert = BundledInsert<Set<Note>>(250, Dispatchers.IO)
|
private val bundlerInsert = BundledInsert<Set<Note>>(250, Dispatchers.IO)
|
||||||
|
|
||||||
override fun invalidateData(ignoreIfDoing: Boolean) {
|
override fun invalidateData(ignoreIfDoing: Boolean) {
|
||||||
|
viewModelScope.launch(Dispatchers.IO) {
|
||||||
bundler.invalidate(ignoreIfDoing) {
|
bundler.invalidate(ignoreIfDoing) {
|
||||||
// adds the time to perform the refresh into this delay
|
// adds the time to perform the refresh into this delay
|
||||||
// holding off new updates in case of heavy refresh routines.
|
// holding off new updates in case of heavy refresh routines.
|
||||||
refreshSuspended()
|
refreshSuspended()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fun checkKeysInvalidateDataAndSendToTop() {
|
fun checkKeysInvalidateDataAndSendToTop() {
|
||||||
if (lastFeedKey != localFilter.feedKey()) {
|
if (lastFeedKey != localFilter.feedKey()) {
|
||||||
|
Reference in New Issue
Block a user