Make minor cleanups.
This commit is contained in:
parent
d3593683df
commit
8c0c8db824
|
@ -20,13 +20,10 @@ final class AppDefaults {
|
|||
static let shared = AppDefaults()
|
||||
|
||||
private struct Key {
|
||||
|
||||
static let firstRunDate = "firstRunDate"
|
||||
|
||||
static let sidebarFontSize = "sidebarFontSize"
|
||||
static let timelineFontSize = "timelineFontSize"
|
||||
static let detailFontSize = "detailFontSize"
|
||||
|
||||
static let openInBrowserInBackground = "openInBrowserInBackground"
|
||||
}
|
||||
|
||||
|
|
|
@ -21,9 +21,9 @@ private let nnwStyleSuffix = ".nnwstyle"
|
|||
private let cssStyleSuffix = ".css"
|
||||
private let styleSuffixes = [styleSuffix, nnwStyleSuffix, cssStyleSuffix];
|
||||
|
||||
public final class ArticleStylesManager {
|
||||
final class ArticleStylesManager {
|
||||
|
||||
static let sharedInstance = ArticleStylesManager()
|
||||
static let shared = ArticleStylesManager()
|
||||
private let folderPath = RSDataSubfolder(nil, stylesFolderName)!
|
||||
|
||||
var currentStyleName: String {
|
||||
|
|
|
@ -14,8 +14,7 @@ import RSWeb
|
|||
func openInBrowser(_ urlString: String) {
|
||||
|
||||
// Opens according to prefs.
|
||||
let openInBackground = UserDefaults.standard.bool(forKey: OpenInBrowserInBackgroundKey)
|
||||
openInBrowser(urlString, inBackground: openInBackground)
|
||||
openInBrowser(urlString, inBackground: AppDefaults.shared.openInBrowserInBackground)
|
||||
}
|
||||
|
||||
func openInBrowser(_ urlString: String, inBackground: Bool) {
|
||||
|
|
|
@ -72,7 +72,7 @@ class DetailViewController: NSViewController, WKNavigationDelegate, WKUIDelegate
|
|||
private func reloadHTML() {
|
||||
|
||||
if let article = article {
|
||||
let articleRenderer = ArticleRenderer(article: article, style: ArticleStylesManager.sharedInstance.currentStyle)
|
||||
let articleRenderer = ArticleRenderer(article: article, style: ArticleStylesManager.shared.currentStyle)
|
||||
webview.loadHTMLString(articleRenderer.html, baseURL: articleRenderer.baseURL)
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Reference in New Issue