Skip to content

Commit

Permalink
Fix bug in manual conversation search query submission.
Browse files Browse the repository at this point in the history
Fixes #9115
  • Loading branch information
greyson-signal committed Oct 21, 2019
1 parent 53e0dc5 commit 09f0c5b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -726,15 +726,15 @@ public boolean onPrepareOptionsMenu(Menu menu) {
SearchView.OnQueryTextListener queryListener = new SearchView.OnQueryTextListener() {
@Override
public boolean onQueryTextSubmit(String query) {
searchViewModel.onQueryUpdated(query, threadId);
searchViewModel.onQueryUpdated(query, threadId, true);
searchNav.showLoading();
fragment.onSearchQueryUpdated(query);
return true;
}

@Override
public boolean onQueryTextChange(String query) {
searchViewModel.onQueryUpdated(query, threadId);
searchViewModel.onQueryUpdated(query, threadId, false);
searchNav.showLoading();
fragment.onSearchQueryUpdated(query);
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ LiveData<SearchResult> getSearchResults() {
return result;
}

void onQueryUpdated(@NonNull String query, long threadId) {
void onQueryUpdated(@NonNull String query, long threadId, boolean forced) {
if (firstSearch && query.length() < 2) {
result.postValue(new SearchResult(CursorList.emptyList(), 0));
return;
}

if (query.equals(activeQuery)) {
if (query.equals(activeQuery) && !forced) {
return;
}

Expand Down

0 comments on commit 09f0c5b

Please sign in to comment.