add text placeholder in web reader to reflect processing and error states

This commit is contained in:
Satindar Dhillon 2022-05-02 20:41:03 -07:00
parent c39ab2d5f7
commit 67a1ad6953
2 changed files with 3 additions and 3 deletions

View file

@ -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)
}

View file

@ -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