mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
Fixed #811
This commit is contained in:
parent
1a8d724d0a
commit
88ba5544fe
1 changed files with 6 additions and 0 deletions
|
@ -110,6 +110,9 @@ class LibraryCategoryAdapter(val controller: LibraryController) :
|
|||
fun performFilter() {
|
||||
val s = getFilter(String::class.java)
|
||||
if (s.isNullOrBlank()) {
|
||||
if (mangas.firstOrNull()?.filter?.isNotBlank() == true) {
|
||||
mangas.forEach { it.filter = "" }
|
||||
}
|
||||
updateDataSet(mangas)
|
||||
} else {
|
||||
updateDataSet(mangas.filter { it.filter(s) })
|
||||
|
@ -120,6 +123,9 @@ class LibraryCategoryAdapter(val controller: LibraryController) :
|
|||
suspend fun performFilterAsync() {
|
||||
val s = getFilter(String::class.java)
|
||||
if (s.isNullOrBlank()) {
|
||||
if (mangas.firstOrNull()?.filter?.isNotBlank() == true) {
|
||||
mangas.forEach { it.filter = "" }
|
||||
}
|
||||
updateDataSet(mangas)
|
||||
} else {
|
||||
val filteredManga = withDefContext { mangas.filter { it.filter(s) } }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue