forked from upstream-mirrors/quik
adds solution
This commit is contained in:
@@ -190,6 +190,7 @@ class MainViewModel @Inject constructor(
|
|||||||
view.queryChangedIntent
|
view.queryChangedIntent
|
||||||
.debounce(200, TimeUnit.MILLISECONDS)
|
.debounce(200, TimeUnit.MILLISECONDS)
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.map { query -> query.trim() }
|
||||||
.withLatestFrom(state) { query, state ->
|
.withLatestFrom(state) { query, state ->
|
||||||
if (query.isEmpty() && state.page is Searching) {
|
if (query.isEmpty() && state.page is Searching) {
|
||||||
newState { copy(page = Inbox(data = conversationRepo.getConversations())) }
|
newState { copy(page = Inbox(data = conversationRepo.getConversations())) }
|
||||||
@@ -197,7 +198,6 @@ class MainViewModel @Inject constructor(
|
|||||||
query
|
query
|
||||||
}
|
}
|
||||||
.filter { query -> query.length >= 2 }
|
.filter { query -> query.length >= 2 }
|
||||||
.map { query -> query.trim() }
|
|
||||||
.distinctUntilChanged()
|
.distinctUntilChanged()
|
||||||
.doOnNext {
|
.doOnNext {
|
||||||
newState {
|
newState {
|
||||||
|
|||||||
Reference in New Issue
Block a user