Load the feed article if the extracted article fails to parse. Issue #1542

This commit is contained in:
Maurice Parker 2020-01-15 17:34:02 -07:00
parent c384362a78
commit 3e604e0b34
1 changed files with 3 additions and 0 deletions

View File

@ -131,6 +131,8 @@ class WebViewController: UIViewController {
if let articleExtractor = articleExtractor, articleExtractor.state == .processing { if let articleExtractor = articleExtractor, articleExtractor.state == .processing {
rendering = ArticleRenderer.loadingHTML(style: style) rendering = ArticleRenderer.loadingHTML(style: style)
} else if let articleExtractor = articleExtractor, articleExtractor.state == .failedToParse, let article = article {
rendering = ArticleRenderer.articleHTML(article: article, style: style, useImageIcon: true)
} else if let article = article, let extractedArticle = extractedArticle { } else if let article = article, let extractedArticle = extractedArticle {
if isShowingExtractedArticle { if isShowingExtractedArticle {
rendering = ArticleRenderer.articleHTML(article: article, extractedArticle: extractedArticle, style: style, useImageIcon: true) rendering = ArticleRenderer.articleHTML(article: article, extractedArticle: extractedArticle, style: style, useImageIcon: true)
@ -295,6 +297,7 @@ extension WebViewController: ArticleExtractorDelegate {
func articleExtractionDidFail(with: Error) { func articleExtractionDidFail(with: Error) {
stopArticleExtractor() stopArticleExtractor()
articleExtractorButtonState = .error articleExtractorButtonState = .error
reloadHTML()
} }
func articleExtractionDidComplete(extractedArticle: ExtractedArticle) { func articleExtractionDidComplete(extractedArticle: ExtractedArticle) {