mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
fix(library): Handle multiple header
This commit is contained in:
parent
00aa93d189
commit
8c5b54df5f
1 changed files with 5 additions and 3 deletions
|
@ -616,9 +616,11 @@ open class LibraryController(
|
||||||
LibraryUpdateJob.updateFlow.onEach(::onUpdateManga).launchIn(viewScope)
|
LibraryUpdateJob.updateFlow.onEach(::onUpdateManga).launchIn(viewScope)
|
||||||
viewScope.launchUI {
|
viewScope.launchUI {
|
||||||
LibraryUpdateJob.isRunningFlow(view.context).collect {
|
LibraryUpdateJob.isRunningFlow(view.context).collect {
|
||||||
val holder = if (mAdapter != null) visibleHeaderHolder() else null
|
adapter.getHeaderPositions().forEach {
|
||||||
val category = holder?.category ?: return@collect
|
val holder = (binding.libraryGridRecycler.recycler.findViewHolderForAdapterPosition(it) as? LibraryHeaderHolder) ?: return@forEach
|
||||||
holder.notifyStatus(LibraryUpdateJob.categoryInQueue(category.id), category)
|
val category = holder.category ?: return@forEach
|
||||||
|
holder.notifyStatus(LibraryUpdateJob.categoryInQueue(category.id), category)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue