Skip to content

Commit

Permalink
Fix fetchSourceManga filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
Syer10 authored Jul 1, 2023
1 parent b9b115d commit 7fe7de5
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ fun updateFilterList(source: CatalogueSource, changes: List<FilterChange>?): Fil
val filterList = source.getFilterList()

changes?.forEach { change ->
when (val filter = filterList[1]) {
when (val filter = filterList[change.position]) {
is SourceFilter.Header -> {
// NOOP
}
Expand All @@ -268,7 +268,7 @@ fun updateFilterList(source: CatalogueSource, changes: List<FilterChange>?): Fil
is SourceFilter.Group<*> -> {
val groupChange = change.groupChange ?: throw Exception("Expected group change at position ${change.position}")

when (val groupFilter = filter.state[1]) {
when (val groupFilter = filter.state[groupChange.position]) {
is SourceFilter.CheckBox -> {
groupFilter.state = groupChange.checkBoxState ?: throw Exception("Expected checkbox state change at position ${change.position}")
}
Expand Down

0 comments on commit 7fe7de5

Please sign in to comment.