mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-23 02:31:51 +01:00
Fix library query being lost
This commit is contained in:
parent
55b7d5025b
commit
1292c0ecea
@ -118,6 +118,8 @@ class LibraryController(
|
|||||||
|
|
||||||
private var tabsVisibilitySubscription: Subscription? = null
|
private var tabsVisibilitySubscription: Subscription? = null
|
||||||
|
|
||||||
|
private var searchViewSubscription: Subscription? = null
|
||||||
|
|
||||||
init {
|
init {
|
||||||
setHasOptionsMenu(true)
|
setHasOptionsMenu(true)
|
||||||
retainViewMode = RetainViewMode.RETAIN_DETACH
|
retainViewMode = RetainViewMode.RETAIN_DETACH
|
||||||
@ -332,7 +334,11 @@ class LibraryController(
|
|||||||
// Mutate the filter icon because it needs to be tinted and the resource is shared.
|
// Mutate the filter icon because it needs to be tinted and the resource is shared.
|
||||||
menu.findItem(R.id.action_filter).icon.mutate()
|
menu.findItem(R.id.action_filter).icon.mutate()
|
||||||
|
|
||||||
searchView.queryTextChanges().subscribeUntilDestroy {
|
searchViewSubscription?.unsubscribe()
|
||||||
|
searchViewSubscription = searchView.queryTextChanges()
|
||||||
|
// Ignore events if this controller isn't at the top
|
||||||
|
.filter { router.backstack.lastOrNull()?.controller() == this }
|
||||||
|
.subscribeUntilDestroy {
|
||||||
query = it.toString()
|
query = it.toString()
|
||||||
searchRelay.call(query)
|
searchRelay.call(query)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user