mirror of
https://github.com/mastodon/mastodon-ios
synced 2025-04-11 22:58:02 +02:00
Fix manual refresh of home timeline not working (IOS-176)
This commit is contained in:
parent
c7d62d56a2
commit
4cb845e0bd
@ -11,6 +11,7 @@ import CoreData
|
||||
import CoreDataStack
|
||||
import GameplayKit
|
||||
import MastodonCore
|
||||
import MastodonSDK
|
||||
|
||||
extension HomeTimelineViewModel {
|
||||
class LoadLatestState: GKState {
|
||||
@ -110,6 +111,11 @@ extension HomeTimelineViewModel.LoadLatestState {
|
||||
if !latestStatusIDs.isEmpty {
|
||||
viewModel.homeTimelineNavigationBarTitleViewModel.newPostsIncoming()
|
||||
}
|
||||
|
||||
let newRecords: [MastodonFeed] = newStatuses.map {
|
||||
MastodonFeed.fromStatus(.fromEntity($0), kind: .home)
|
||||
}
|
||||
viewModel.fetchedResultsController.records = newRecords + viewModel.fetchedResultsController.records
|
||||
}
|
||||
viewModel.timelineIsEmpty.value = latestStatusIDs.isEmpty && statuses.isEmpty
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user