From 2082c97ed6ed0e6756242849681580719d005dad Mon Sep 17 00:00:00 2001 From: Austin Huang Date: Fri, 9 Jul 2021 16:49:50 -0400 Subject: [PATCH] close #1555 --- .../awais/instagrabber/fragments/search/SearchFragment.java | 1 + .../awais/instagrabber/viewmodels/SearchFragmentViewModel.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/awais/instagrabber/fragments/search/SearchFragment.java b/app/src/main/java/awais/instagrabber/fragments/search/SearchFragment.java index 371793cc..96cb0191 100644 --- a/app/src/main/java/awais/instagrabber/fragments/search/SearchFragment.java +++ b/app/src/main/java/awais/instagrabber/fragments/search/SearchFragment.java @@ -239,6 +239,7 @@ public class SearchFragment extends Fragment implements SearchCategoryFragment.O switch (resource.status) { case SUCCESS: viewModel.search("", type); + viewModel.search("", FavoriteType.TOP); liveData.removeObserver(this); break; case ERROR: diff --git a/app/src/main/java/awais/instagrabber/viewmodels/SearchFragmentViewModel.java b/app/src/main/java/awais/instagrabber/viewmodels/SearchFragmentViewModel.java index da2d0618..45825297 100644 --- a/app/src/main/java/awais/instagrabber/viewmodels/SearchFragmentViewModel.java +++ b/app/src/main/java/awais/instagrabber/viewmodels/SearchFragmentViewModel.java @@ -242,7 +242,7 @@ public class SearchFragmentViewModel extends AppStateViewModel { @Override public void onFailure(@NonNull final Throwable t) { if (!TextUtils.isEmpty(tempQuery)) return; - topResults.postValue(Resource.success(Collections.emptyList())); + liveData.postValue(Resource.success(Collections.emptyList())); Log.e(TAG, "onFailure: ", t); } }, AppExecutors.INSTANCE.getMainThread());