mirror of
https://github.com/rebelonion/Dantotsu.git
synced 2026-01-26 04:11:03 +00:00
fix: combine anilist init queries into one query
This commit is contained in:
@@ -305,7 +305,7 @@ class HomeFragment : Fragment() {
|
||||
}
|
||||
}
|
||||
|
||||
val array = arrayOf(
|
||||
val array = arrayOf( //deprecated: no longer should be run. only indices are used
|
||||
Runnable { runBlocking { model.setAnimeContinue() } },
|
||||
Runnable { runBlocking { model.setAnimeFav() } },
|
||||
Runnable { runBlocking { model.setAnimePlanned() } },
|
||||
@@ -339,9 +339,11 @@ class HomeFragment : Fragment() {
|
||||
var empty = true
|
||||
val homeLayoutShow: List<Boolean> =
|
||||
PrefManager.getVal(PrefName.HomeLayoutShow)
|
||||
runBlocking {
|
||||
model.initHomePage()
|
||||
}
|
||||
(array.indices).forEach { i ->
|
||||
if (homeLayoutShow.elementAt(i)) {
|
||||
array[i].run()
|
||||
empty = false
|
||||
} else withContext(Dispatchers.Main) {
|
||||
containers[i].visibility = View.GONE
|
||||
|
||||
Reference in New Issue
Block a user