From 1a70ebe7eaeed9665cedf3a7dc2dd583af05031d Mon Sep 17 00:00:00 2001 From: Ivan Iskandar <12537387+ivaniskandar@users.noreply.github.com> Date: Sat, 3 Dec 2022 12:26:11 +0700 Subject: [PATCH] Fix crash when opening chapter from BrowseSourceScreen (#8657) --- .../tachiyomi/ui/browse/source/browse/BrowseSourceScreen.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourceScreen.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourceScreen.kt index 9d4f821bd..1c37126b1 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourceScreen.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourceScreen.kt @@ -256,10 +256,13 @@ data class BrowseSourceScreen( } } - private val queryEvent = Channel() 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() + } + sealed class SearchType(val txt: String) { class Text(txt: String) : SearchType(txt) class Genre(txt: String) : SearchType(txt)