Remove unintended web view load when changing the article.
This commit is contained in:
parent
2ae021960b
commit
d01e9cef42
|
@ -46,11 +46,7 @@ class WebViewController: UIViewController {
|
||||||
windowScrollY = 0
|
windowScrollY = 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var isShowingExtractedArticle = false {
|
var isShowingExtractedArticle = false
|
||||||
didSet {
|
|
||||||
loadWebView()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var articleExtractorButtonState: ArticleExtractorButtonState = .off {
|
var articleExtractorButtonState: ArticleExtractorButtonState = .off {
|
||||||
didSet {
|
didSet {
|
||||||
|
@ -189,11 +185,13 @@ class WebViewController: UIViewController {
|
||||||
|
|
||||||
guard articleExtractor?.state != .processing else {
|
guard articleExtractor?.state != .processing else {
|
||||||
stopArticleExtractor()
|
stopArticleExtractor()
|
||||||
|
loadWebView()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
guard !isShowingExtractedArticle else {
|
guard !isShowingExtractedArticle else {
|
||||||
isShowingExtractedArticle = false
|
isShowingExtractedArticle = false
|
||||||
|
loadWebView()
|
||||||
articleExtractorButtonState = .off
|
articleExtractorButtonState = .off
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -201,6 +199,7 @@ class WebViewController: UIViewController {
|
||||||
if let articleExtractor = articleExtractor {
|
if let articleExtractor = articleExtractor {
|
||||||
if article.preferredLink == articleExtractor.articleLink {
|
if article.preferredLink == articleExtractor.articleLink {
|
||||||
isShowingExtractedArticle = true
|
isShowingExtractedArticle = true
|
||||||
|
loadWebView()
|
||||||
articleExtractorButtonState = .on
|
articleExtractorButtonState = .on
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -241,6 +240,7 @@ extension WebViewController: ArticleExtractorDelegate {
|
||||||
if articleExtractor?.state != .cancelled {
|
if articleExtractor?.state != .cancelled {
|
||||||
self.extractedArticle = extractedArticle
|
self.extractedArticle = extractedArticle
|
||||||
isShowingExtractedArticle = true
|
isShowingExtractedArticle = true
|
||||||
|
loadWebView()
|
||||||
articleExtractorButtonState = .on
|
articleExtractorButtonState = .on
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue