Fix bug of search history randomly not saved
Don't create disposable from operation of storing search to history because as we certainly want this to complete. Disposable was created in `search` method and then alsmost immediately was called `startLoading` which disposed "all" disposables including our operation of search storing (if was unlucky enough to not finish before this moment)
This commit is contained in:
parent
2f063a78ba
commit
7d28ac96e2
@ -865,14 +865,15 @@ public class SearchFragment extends BaseListFragment<SearchInfo, ListExtractor.I
|
||||
hideKeyboardSearch();
|
||||
|
||||
// store search query if search history is enabled
|
||||
disposables.add(historyRecordManager.onSearched(serviceId, theSearchString)
|
||||
|
||||
historyRecordManager.onSearched(serviceId, theSearchString)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(
|
||||
ignored -> {
|
||||
},
|
||||
throwable -> showSnackBarError(new ErrorInfo(throwable, UserAction.SEARCHED,
|
||||
theSearchString, serviceId))
|
||||
));
|
||||
);
|
||||
|
||||
// load search results
|
||||
suggestionPublisher.onNext(theSearchString);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user