Reload the article if the theme changes

This commit is contained in:
Maurice Parker 2021-09-08 15:55:42 -05:00
parent a645ac9458
commit 596202fc33
1 changed files with 5 additions and 0 deletions

View File

@ -116,6 +116,7 @@ final class DetailWebViewController: NSViewController {
NotificationCenter.default.addObserver(self, selector: #selector(avatarDidBecomeAvailable(_:)), name: .AvatarDidBecomeAvailable, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(faviconDidBecomeAvailable(_:)), name: .FaviconDidBecomeAvailable, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(userDefaultsDidChange(_:)), name: UserDefaults.didChangeNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(currentArticleThemeDidChangeNotification(_:)), name: .CurrentArticleThemeDidChangeNotification, object: nil)
webView.loadFileURL(ArticleRenderer.blank.url, allowingReadAccessTo: ArticleRenderer.blank.baseURL)
}
@ -141,6 +142,10 @@ final class DetailWebViewController: NSViewController {
}
}
@objc func currentArticleThemeDidChangeNotification(_ note: Notification) {
reloadHTML()
}
// MARK: Media Functions
func stopMediaPlayback() {