Skip to content

Commit

Permalink
Fix themeing update
Browse files Browse the repository at this point in the history
  • Loading branch information
d4r1091 committed May 16, 2024
1 parent 1870997 commit 754805b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Client.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@
2C1298A62BF5EB1E005AE4E4 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 2C1298A42BF5EB16005AE4E4 /* PrivacyInfo.xcprivacy */; };
2C1298A72BF5EB1F005AE4E4 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 2C1298A42BF5EB16005AE4E4 /* PrivacyInfo.xcprivacy */; };
2C1F23BD2B9F405E00186F55 /* Core in Frameworks */ = {isa = PBXBuildFile; productRef = 2C1F23BC2B9F405E00186F55 /* Core */; };
2C3BD5EB2BF6193B00E25B0D /* EcosiaThemeManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C6188C32B7A8A22006B70D7 /* EcosiaThemeManager.swift */; };
2C4414422BD7B43F00249464 /* BingDistributionExperiment.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C4414412BD7B43F00249464 /* BingDistributionExperiment.swift */; };
2C4414452BD7B4D800249464 /* BingDistributionExperimentTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C4414432BD7B4D000249464 /* BingDistributionExperimentTests.swift */; };
2C4414462BD7B68600249464 /* BingDistributionExperiment.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C4414412BD7B43F00249464 /* BingDistributionExperiment.swift */; };
Expand Down Expand Up @@ -13181,6 +13182,7 @@
047F9B4224E1FF4000CD7DF7 /* ImageButtonWithLabel.swift in Sources */,
2C6189DE2B7B78ED006B70D7 /* LegacyTheme.swift in Sources */,
047F9B2C24E1FE1C00CD7DF7 /* WidgetKit.swift in Sources */,
2C3BD5EB2BF6193B00E25B0D /* EcosiaThemeManager.swift in Sources */,
1DA3CE6724EEE86C00422BB2 /* AppInfo.swift in Sources */,
4392FB34252EC4CE00AD3D23 /* SessionRestoreHandler.swift in Sources */,
DA9FD88824E213DD00168D1E /* QuickLink.swift in Sources */,
Expand Down
5 changes: 5 additions & 0 deletions Client/Ecosia/UI/Theme/EcosiaThemeManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ public final class EcosiaThemeManager: ThemeManager, Notifiable {
self.userDefaults.register(defaults: [ThemeKeys.systemThemeIsOn: true,
ThemeKeys.NightMode.isOn: NSNumber(value: false)])

if LegacyThemeManager.instance.systemThemeIsOn {
let userInterfaceStyle = UIScreen.main.traitCollection.userInterfaceStyle
LegacyThemeManager.instance.current = userInterfaceStyle == .dark ? LegacyDarkTheme() : LegacyNormalTheme()
}

changeCurrentTheme(loadInitialThemeType())

setupNotifications(forObserver: self,
Expand Down

0 comments on commit 754805b

Please sign in to comment.