From 67a1ad69538a7eaf703918d3104d549c8a47cf7f Mon Sep 17 00:00:00 2001 From: Satindar Dhillon Date: Mon, 2 May 2022 20:41:03 -0700 Subject: [PATCH] add text placeholder in web reader to reflect processing and error states --- .../Sources/App/Views/WebReader/WebReaderContainer.swift | 4 ++-- .../Sources/App/Views/WebReader/WebReaderViewModel.swift | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift b/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift index 47461f835..c8e26c311 100644 --- a/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift +++ b/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift @@ -187,8 +187,8 @@ import WebKit ) } } else { - Color.clear - .contentShape(Rectangle()) + Text(viewModel.contentFetchFailed ? "Unable to fetch content." : "Processing...") + .padding() .task { await viewModel.loadContent(dataService: dataService, itemID: item.unwrappedID) } diff --git a/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderViewModel.swift b/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderViewModel.swift index 890576817..97017cfd8 100644 --- a/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderViewModel.swift +++ b/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderViewModel.swift @@ -10,7 +10,7 @@ struct SafariWebLink: Identifiable { @MainActor final class WebReaderViewModel: ObservableObject { @Published var articleContent: ArticleContent? - @Published var contentFetchFailed = false // update UI to reflect this + @Published var contentFetchFailed = false func loadContent(dataService: DataService, itemID: String) async { contentFetchFailed = false