Fix loading placeholder being stuck in timeline indefinitely.

When top status in TL is deleted and another one is added we get a
placeholder. We were not sending update after removing this placeholder
correctly.

This does not fix the fact that removed statuses is still in timeline.
This commit is contained in:
charlag 2021-07-01 22:38:49 +02:00
parent 34a16c1f25
commit 357250f6d5
No known key found for this signature in database
GPG Key ID: 5B96E7C76F0CA558
1 changed files with 5 additions and 0 deletions

View File

@ -610,6 +610,10 @@ class TimelineViewModel @Inject constructor(
}
}
/**
* "full" in a sense that we get as many statuses as we requested, meaning there might be more
* still.
*/
private fun isFullFetch(statuses: List<TimelineStatus>) = statuses.size >= LOAD_AT_ONCE
private fun fullyRefresh(): Job {
@ -674,6 +678,7 @@ class TimelineViewModel @Inject constructor(
statuses.removeAt(pos)
}
if (newStatuses.isEmpty()) {
triggerViewUpdate()
return
}
val newViewData = newStatuses