mirror of
https://github.com/anyproto/anytype-kotlin.git
synced 2025-06-08 13:57:10 +09:00
When searching for pages, if query text is empty space, query returns only pages where title contains empty spaces (#747)
This commit is contained in:
parent
65d79a0cc8
commit
2b29ad7e0e
2 changed files with 10 additions and 9 deletions
|
@ -4,6 +4,7 @@
|
|||
|
||||
### Fixes & tech 🚒
|
||||
|
||||
* When searching for pages, if filter text is empty space, query returns only pages where title contains empty spaces (#746)
|
||||
* Regression. Text is not always set when creating a lot of text blocks (#741)
|
||||
* Respective theme colors should differ for text color and background colors in action menu (#738)
|
||||
* Fix app configuration lifetime (#735)
|
||||
|
|
|
@ -53,15 +53,15 @@ class PageSearchViewModel(
|
|||
}
|
||||
|
||||
private fun proceedWithResults(original: List<PageLinkView>, filter: String) {
|
||||
val filtered = original.filterBy(filter)
|
||||
when (filtered.isNotEmpty()) {
|
||||
true -> stateData.postValue(PageSearchView.Success(pages = filtered))
|
||||
false -> {
|
||||
when (filter.isEmpty()) {
|
||||
true -> stateData.postValue(PageSearchView.EmptyPages)
|
||||
false -> stateData.postValue(PageSearchView.NoResults(filter))
|
||||
}
|
||||
}
|
||||
val query = filter.trim()
|
||||
val filtered = original.filterBy(query)
|
||||
if (filtered.isNotEmpty()) {
|
||||
stateData.postValue(PageSearchView.Success(pages = filtered))
|
||||
} else {
|
||||
if (query.isEmpty())
|
||||
stateData.postValue(PageSearchView.EmptyPages)
|
||||
else
|
||||
stateData.postValue(PageSearchView.NoResults(query))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue