diff --git a/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewModel.swift b/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewModel.swift index 418db4b50..7852265a6 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewModel.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewModel.swift @@ -116,9 +116,10 @@ import Views // If possible start prefetching new pages in the background if let itemIDs = syncResult?.updatedItemIDs, let username = dataService.currentViewer?.username, - itemIDs.count > 0 { + itemIDs.count > 0 + { Task { - await dataService.prefetchPages(itemIDs: itemIDs.map { $0.uriRepresentation().absoluteString }, username: username) + await dataService.prefetchPages(itemIDs: itemIDs, username: username) } } } diff --git a/apple/OmnivoreKit/Sources/Services/DataService/Public/LinkedItemContentLoading.swift b/apple/OmnivoreKit/Sources/Services/DataService/Public/LinkedItemContentLoading.swift index a4bc86ea1..e755f1510 100644 --- a/apple/OmnivoreKit/Sources/Services/DataService/Public/LinkedItemContentLoading.swift +++ b/apple/OmnivoreKit/Sources/Services/DataService/Public/LinkedItemContentLoading.swift @@ -6,7 +6,6 @@ import Utils public extension DataService { func prefetchPages(itemIDs: [String], username: String) async { await withTaskGroup(of: Void.self) { group in - print(" PREFETCHING PAGES: ", itemIDs) for itemID in itemIDs { group.addTask { await self.prefetchPage(pendingLink: PendingLink(itemID: itemID, retryCount: 1), username: username) diff --git a/apple/OmnivoreKit/Sources/Services/DataService/Public/LinkedItemLoading.swift b/apple/OmnivoreKit/Sources/Services/DataService/Public/LinkedItemLoading.swift index ea5d8ff0e..70806fdfe 100644 --- a/apple/OmnivoreKit/Sources/Services/DataService/Public/LinkedItemLoading.swift +++ b/apple/OmnivoreKit/Sources/Services/DataService/Public/LinkedItemLoading.swift @@ -30,10 +30,9 @@ public extension DataService { throw BasicError.message(messageText: "CoreData error") } - let prev = previousQueryResult?.updatedItemIDs ?? [] let result = LinkedItemSyncResult( - updatedItemIDs: prev + fetchResult.items.map { $0.id }, + updatedItemIDs: prev + fetchResult.items.map(\.id), cursor: fetchResult.cursor )