Use cached PDFs if available

This commit is contained in:
Jackson Harper
2022-06-09 10:44:00 -07:00
parent 5537766a45
commit ce040b8983

View File

@ -90,6 +90,9 @@ public final class PDFViewerViewModel: ObservableObject {
public func downloadPDF(dataService: DataService) async -> URL? {
do {
if itemDownloaded {
return pdfItem.localPdfURL
}
if let localURL = try await dataService.fetchPDFData(slug: pdfItem.slug, pageURLString: pdfItem.originalArticleURL) {
return localURL
}