mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-10 20:57:24 +01:00
Fix library bugs (#7648)
- Fix mixup in Action Menu - Fix back action not clearing search
This commit is contained in:
parent
7d74b174e0
commit
db93d1da76
@ -53,8 +53,8 @@ fun LibraryScreen(
|
|||||||
onChangeCategoryClicked = onChangeCategoryClicked,
|
onChangeCategoryClicked = onChangeCategoryClicked,
|
||||||
onMarkAsReadClicked = onMarkAsReadClicked,
|
onMarkAsReadClicked = onMarkAsReadClicked,
|
||||||
onMarkAsUnreadClicked = onMarkAsUnreadClicked,
|
onMarkAsUnreadClicked = onMarkAsUnreadClicked,
|
||||||
onDownloadClicked = onDownloadClicked,
|
onDownloadClicked = onDownloadClicked.takeIf { presenter.selection.none { it.source == LocalSource.ID } },
|
||||||
onDeleteClicked = onDeleteClicked.takeIf { presenter.selection.none { it.source == LocalSource.ID } },
|
onDeleteClicked = onDeleteClicked,
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
) { paddingValues ->
|
) { paddingValues ->
|
||||||
|
@ -78,11 +78,17 @@ class LibraryController(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun handleBack(): Boolean {
|
override fun handleBack(): Boolean {
|
||||||
if (presenter.selection.isNotEmpty()) {
|
return when {
|
||||||
presenter.clearSelection()
|
presenter.selection.isNotEmpty() -> {
|
||||||
return true
|
presenter.clearSelection()
|
||||||
|
true
|
||||||
|
}
|
||||||
|
presenter.searchQuery != null -> {
|
||||||
|
presenter.searchQuery = null
|
||||||
|
true
|
||||||
|
}
|
||||||
|
else -> false
|
||||||
}
|
}
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onViewCreated(view: View) {
|
override fun onViewCreated(view: View) {
|
||||||
|
Loading…
Reference in New Issue
Block a user