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:
Yevhen Babiichuk (DustDFG) 2026-01-14 17:05:38 +02:00
parent 2f063a78ba
commit 7d28ac96e2

View File

@ -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);