1
0
mirror of https://github.com/apognu/otter synced 2024-12-11 23:05:17 +01:00

Fix IO thread performing UI task on some occasion (#59).

This commit is contained in:
Antoine POPINEAU 2020-07-09 10:45:52 +02:00
parent 5d397ab1fe
commit 4b2cf10e78
No known key found for this signature in database
GPG Key ID: A78AC64694F84063

View File

@ -101,8 +101,10 @@ abstract class FunkwhaleFragment<D : Any, A : FunkwhaleAdapter<D, *>> : Fragment
var first = size == 0
if (!moreLoading && upstreams == Repository.Origin.Network.origin) {
lifecycleScope.launch(Main) {
swiper?.isRefreshing = true
}
}
repository.fetch(upstreams, size).untilNetwork(lifecycleScope, IO) { data, isCache, page, hasMore ->
if (isCache && data.isEmpty()) {