Skip to content

Commit

Permalink
Merge pull request #1 from octoshrimpy:feat/search-space
Browse files Browse the repository at this point in the history
adds solution
  • Loading branch information
octoshrimpy authored Jul 17, 2023
2 parents c86ea10 + 6d6f7f0 commit 7d7cc59
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,14 @@ class MainViewModel @Inject constructor(
view.queryChangedIntent
.debounce(200, TimeUnit.MILLISECONDS)
.observeOn(AndroidSchedulers.mainThread())
.map { query -> query.trim() }
.withLatestFrom(state) { query, state ->
if (query.isEmpty() && state.page is Searching) {
newState { copy(page = Inbox(data = conversationRepo.getConversations())) }
}
query
}
.filter { query -> query.length >= 2 }
.map { query -> query.trim() }
.distinctUntilChanged()
.doOnNext {
newState {
Expand Down

0 comments on commit 7d7cc59

Please sign in to comment.