mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-10-10 18:13:28 +02:00
Puts an invalidate data on an IO thread
This commit is contained in:
@@ -292,10 +292,12 @@ 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) {
|
||||||
bundler.invalidate(ignoreIfDoing) {
|
viewModelScope.launch(Dispatchers.IO) {
|
||||||
// adds the time to perform the refresh into this delay
|
bundler.invalidate(ignoreIfDoing) {
|
||||||
// holding off new updates in case of heavy refresh routines.
|
// adds the time to perform the refresh into this delay
|
||||||
refreshSuspended()
|
// holding off new updates in case of heavy refresh routines.
|
||||||
|
refreshSuspended()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user