Don't start the article extractor if we only want to store the article. Issue #1494

This commit is contained in:
Maurice Parker
2020-03-14 06:31:14 -05:00
parent aee37925da
commit 07dc4f1f10
2 changed files with 21 additions and 16 deletions

View File

@@ -57,18 +57,7 @@ class WebViewController: UIViewController {
weak var coordinator: SceneCoordinator!
weak var delegate: WebViewControllerDelegate?
var article: Article? {
didSet {
stopArticleExtractor()
if article?.webFeed?.isArticleExtractorAlwaysOn ?? false {
startArticleExtractor()
}
if article != oldValue {
windowScrollY = 0
loadWebView()
}
}
}
private(set) var article: Article?
let scrollPositionQueue = CoalescingQueue(name: "Article Scroll Position", interval: 0.3, maxInterval: 1.0)
var windowScrollY = 0
@@ -114,6 +103,22 @@ class WebViewController: UIViewController {
// MARK: API
func setArticle(_ article: Article?, updateView: Bool = true) {
stopArticleExtractor()
if article != self.article {
self.article = article
if updateView {
if article?.webFeed?.isArticleExtractorAlwaysOn ?? false {
startArticleExtractor()
}
windowScrollY = 0
loadWebView()
}
}
}
func focus() {
webView?.becomeFirstResponder()
}