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);
i.putExtra("login_url", redirectUrl);
startActivity(i);
requireActivity().finish();
} else {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

View file

@ -429,7 +429,7 @@ public class FragmentMastodonTimeline extends Fragment {
new Thread(() -> {
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 = quickLoad.statuses;
statuses.pagination = new Pagination();
@ -590,7 +590,7 @@ public class FragmentMastodonTimeline extends Fragment {
fetchMarker = true;
}
//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
timelinesVM.getMarker(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, markers).observe(getViewLifecycleOwner(), marker -> {
if (marker != null) {