Fix crash when opening chapter from BrowseSourceScreen (#8657)

This commit is contained in:
Ivan Iskandar 2022-12-03 12:26:11 +07:00 committed by GitHub
parent beda99bbe0
commit 1a70ebe7ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -256,10 +256,13 @@ data class BrowseSourceScreen(
}
}
private val queryEvent = Channel<SearchType>()
suspend fun search(query: String) = queryEvent.send(SearchType.Text(query))
suspend fun searchGenre(name: String) = queryEvent.send(SearchType.Genre(name))
companion object {
private val queryEvent = Channel<SearchType>()
}
sealed class SearchType(val txt: String) {
class Text(txt: String) : SearchType(txt)
class Genre(txt: String) : SearchType(txt)