diff --git a/app/src/main/java/eu/kanade/presentation/library/LibraryScreen.kt b/app/src/main/java/eu/kanade/presentation/library/LibraryScreen.kt index fec2432ea..1f7baaa8c 100644 --- a/app/src/main/java/eu/kanade/presentation/library/LibraryScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/library/LibraryScreen.kt @@ -53,8 +53,8 @@ fun LibraryScreen( onChangeCategoryClicked = onChangeCategoryClicked, onMarkAsReadClicked = onMarkAsReadClicked, onMarkAsUnreadClicked = onMarkAsUnreadClicked, - onDownloadClicked = onDownloadClicked, - onDeleteClicked = onDeleteClicked.takeIf { presenter.selection.none { it.source == LocalSource.ID } }, + onDownloadClicked = onDownloadClicked.takeIf { presenter.selection.none { it.source == LocalSource.ID } }, + onDeleteClicked = onDeleteClicked, ) }, ) { paddingValues -> diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt index a1f9553f0..cec1a6f07 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt @@ -78,11 +78,17 @@ class LibraryController( } override fun handleBack(): Boolean { - if (presenter.selection.isNotEmpty()) { - presenter.clearSelection() - return true + return when { + presenter.selection.isNotEmpty() -> { + presenter.clearSelection() + true + } + presenter.searchQuery != null -> { + presenter.searchQuery = null + true + } + else -> false } - return false } override fun onViewCreated(view: View) {