use core data to track reading progress

This commit is contained in:
Satindar Dhillon
2022-04-25 12:17:27 -07:00
parent 9c7a0d2ee9
commit 9828846222
4 changed files with 49 additions and 75 deletions

View File

@ -75,18 +75,11 @@ public final class PDFViewerViewModel: ObservableObject {
}
public func updateItemReadProgress(percent: Double, anchorIndex: Int) {
services.dataService
.updateArticleReadingProgressPublisher(
itemID: linkedItem.unwrappedID,
readingProgress: percent,
anchorIndex: anchorIndex
)
.sink { completion in
guard case let .failure(error) = completion else { return }
print(error)
} receiveValue: { _ in
}
.store(in: &subscriptions)
services.dataService.updateLinkReadingProgress(
itemID: linkedItem.unwrappedID,
readingProgress: percent,
anchorIndex: anchorIndex
)
}
public func highlightShareURL(shortId: String) -> URL? {