Fixes #3739 - Theme menu updates after selection

This commit is contained in:
Stuart Breckenridge
2022-11-12 14:46:42 +08:00
parent 35440ba542
commit 2f1f673afe
2 changed files with 6 additions and 5 deletions

View File

@@ -11,8 +11,9 @@ import WebKit
import Account
import Articles
import SafariServices
import RSCore
class ArticleViewController: UIViewController, MainControllerIdentifiable {
class ArticleViewController: UIViewController, MainControllerIdentifiable, Logging {
typealias State = (extractedArticle: ExtractedArticle?,
isShowingExtractedArticle: Bool,
@@ -259,7 +260,7 @@ class ArticleViewController: UIViewController, MainControllerIdentifiable {
identifier: nil,
discoverabilityTitle: nil,
attributes: [],
state: ArticleThemesManager.shared.currentThemeName == themeName ? .on : .off,
state: ArticleThemesManager.shared.currentTheme.name == themeName ? .on : .off,
handler: { action in
ArticleThemesManager.shared.currentThemeName = themeName
})
@@ -271,7 +272,7 @@ class ArticleViewController: UIViewController, MainControllerIdentifiable {
identifier: nil,
discoverabilityTitle: nil,
attributes: [],
state: ArticleThemesManager.shared.currentThemeName == AppDefaults.defaultThemeName ? .on : .off,
state: ArticleThemesManager.shared.currentTheme.name == AppDefaults.defaultThemeName ? .on : .off,
handler: { _ in
ArticleThemesManager.shared.currentThemeName = AppDefaults.defaultThemeName
})