Skip to content

Commit

Permalink
fix(library): Handle multiple header
Browse files Browse the repository at this point in the history
  • Loading branch information
null2264 committed Dec 14, 2024
1 parent 00aa93d commit 8c5b54d
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -616,9 +616,11 @@ open class LibraryController(
LibraryUpdateJob.updateFlow.onEach(::onUpdateManga).launchIn(viewScope)
viewScope.launchUI {
LibraryUpdateJob.isRunningFlow(view.context).collect {
val holder = if (mAdapter != null) visibleHeaderHolder() else null
val category = holder?.category ?: return@collect
holder.notifyStatus(LibraryUpdateJob.categoryInQueue(category.id), category)
adapter.getHeaderPositions().forEach {
val holder = (binding.libraryGridRecycler.recycler.findViewHolderForAdapterPosition(it) as? LibraryHeaderHolder) ?: return@forEach
val category = holder.category ?: return@forEach
holder.notifyStatus(LibraryUpdateJob.categoryInQueue(category.id), category)
}
}
}

Expand Down

0 comments on commit 8c5b54d

Please sign in to comment.