diff --git a/Mastodon/Scene/HomeTimeline/HomeTimelineViewModel+LoadLatestState.swift b/Mastodon/Scene/HomeTimeline/HomeTimelineViewModel+LoadLatestState.swift index fe99a07e4..2a6f5848b 100644 --- a/Mastodon/Scene/HomeTimeline/HomeTimelineViewModel+LoadLatestState.swift +++ b/Mastodon/Scene/HomeTimeline/HomeTimelineViewModel+LoadLatestState.swift @@ -147,10 +147,15 @@ extension HomeTimelineViewModel.LoadLatestState { let last = statuses.last if let latestFirstId = latestFeedRecords.first?.id, let last, last.id == latestFirstId { + /// We have an overlap with the existing Statuses, thus no _Load More_ required toAdd = statuses.prefix(statuses.count-1).map({ MastodonFeed.fromStatus($0.asMastodonStatus, kind: .home) }) - } else { + } else if latestFeedRecords.isNotEmpty { + /// Our fetched Statuses do **not** overlap with the existing ones, we need a _Load More_ Button toAdd = statuses.map({ MastodonFeed.fromStatus($0.asMastodonStatus, kind: .home) }) toAdd.last?.hasMore = true + } else { + /// We do not have existing items, no load more is required as there can't be a gap + toAdd = statuses.map({ MastodonFeed.fromStatus($0.asMastodonStatus, kind: .home) }) } viewModel.dataController.records = (toAdd + latestFeedRecords).removingDuplicates()