Fix an issue for pull to refresh and home

This commit is contained in:
Thomas 2022-05-07 19:17:37 +02:00
parent ea984f0553
commit f3719cef7e
2 changed files with 3 additions and 2 deletions

View File

@ -257,6 +257,7 @@ public class FragmentLoginMain extends Fragment {
Intent i = new Intent(requireActivity(), WebviewConnectActivity.class); Intent i = new Intent(requireActivity(), WebviewConnectActivity.class);
i.putExtra("login_url", redirectUrl); i.putExtra("login_url", redirectUrl);
startActivity(i); startActivity(i);
requireActivity().finish();
} else { } else {
Intent intent = new Intent(Intent.ACTION_VIEW); Intent intent = new Intent(Intent.ACTION_VIEW);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

View File

@ -429,7 +429,7 @@ public class FragmentMastodonTimeline extends Fragment {
new Thread(() -> { new Thread(() -> {
QuickLoad quickLoad = new QuickLoad(requireActivity()).getSavedValue(timelineType, ident); QuickLoad quickLoad = new QuickLoad(requireActivity()).getSavedValue(timelineType, ident);
if (direction == null && quickLoad != null && quickLoad.statuses != null && quickLoad.statuses.size() > 0) { if (!binding.swipeContainer.isRefreshing() && direction == null && quickLoad != null && quickLoad.statuses != null && quickLoad.statuses.size() > 0) {
Statuses statuses = new Statuses(); Statuses statuses = new Statuses();
statuses.statuses = quickLoad.statuses; statuses.statuses = quickLoad.statuses;
statuses.pagination = new Pagination(); statuses.pagination = new Pagination();
@ -590,7 +590,7 @@ public class FragmentMastodonTimeline extends Fragment {
fetchMarker = true; fetchMarker = true;
} }
//We search for marker only once - It should not be fetched again when pull to refresh //We search for marker only once - It should not be fetched again when pull to refresh
if (fetchMarker) { if (fetchMarker && !binding.swipeContainer.isRefreshing()) {
//Search for last position //Search for last position
timelinesVM.getMarker(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, markers).observe(getViewLifecycleOwner(), marker -> { timelinesVM.getMarker(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, markers).observe(getViewLifecycleOwner(), marker -> {
if (marker != null) { if (marker != null) {