diff --git a/Mastodon/Scene/HomeTimeline/HomeTimelineViewModel.swift b/Mastodon/Scene/HomeTimeline/HomeTimelineViewModel.swift index f60935f63..b629c2771 100644 --- a/Mastodon/Scene/HomeTimeline/HomeTimelineViewModel.swift +++ b/Mastodon/Scene/HomeTimeline/HomeTimelineViewModel.swift @@ -173,22 +173,40 @@ extension HomeTimelineViewModel { } // insert missing items - if let items = response?.value { - let feedItems: [MastodonFeed] = items.map { .fromStatus($0.asMastodonStatus, kind: .home, hasMore: false) } - - let firstIndex = indexPath.row - let count = dataController.records.count - let head = dataController.records[.. we got another gap + hasMore = item != head.first?.status?.entity + } + + feedItems.append( + .fromStatus(item.asMastodonStatus, kind: .home, hasMore: hasMore) + ) + } + + let combinedRecords = Array(head + feedItems + tail) + dataController.records = combinedRecords + + record.isLoadingMore = false + record.hasMore = false } }