Simplify articles and article variables.

This commit is contained in:
Brent Simmons 2019-02-10 21:46:53 -08:00
parent 1498823c20
commit 9d9afea52a
1 changed files with 3 additions and 10 deletions

View File

@ -21,23 +21,16 @@ final class DetailViewController: NSViewController, WKUIDelegate {
var articles: [Article]? {
didSet {
if let articles = articles, articles.count == 1 {
article = articles.first!
if articles == articles {
return
}
statusBarView.mouseoverLink = nil
article = nil
reloadHTML()
}
}
private var article: Article? {
didSet {
if article != nil, article != oldValue {
statusBarView.mouseoverLink = nil
reloadHTML()
}
}
return articles?.first
}
private var webviewIsHidden: Bool {