forked from mirrors/Fedilab
Fix cached
This commit is contained in:
parent
aedb81d0e5
commit
3d4f075c9c
2 changed files with 7 additions and 0 deletions
|
@ -358,6 +358,9 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter.
|
|||
private void initializeStatusesCommonView(final Statuses statuses) {
|
||||
flagLoading = false;
|
||||
if (binding == null || !isAdded() || getActivity() == null) {
|
||||
if (binding != null) {
|
||||
binding.loader.setVisibility(View.GONE);
|
||||
}
|
||||
return;
|
||||
}
|
||||
binding.loader.setVisibility(View.GONE);
|
||||
|
@ -643,6 +646,9 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter.
|
|||
}
|
||||
|
||||
private void getCachedStatus(DIRECTION direction, boolean fetchingMissing, TimelinesVM.TimelineParams timelineParams) {
|
||||
if (getView() == null) {
|
||||
return;
|
||||
}
|
||||
if (direction == null) {
|
||||
timelinesVM.getTimelineCache(timelineStatuses, timelineParams)
|
||||
.observe(getViewLifecycleOwner(), statusesCached -> {
|
||||
|
|
|
@ -461,6 +461,7 @@ public class TimelinesVM extends AndroidViewModel {
|
|||
List<Status> notPresentStatuses = new ArrayList<>();
|
||||
for (Status status : statuses.statuses) {
|
||||
if (!timelineStatuses.contains(status)) {
|
||||
status.cached = true;
|
||||
notPresentStatuses.add(status);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue