From 58da713ab231c8538844ed6c2bb6be3a24a0c3b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20W=C5=82odarczak?= Date: Sun, 30 May 2021 23:59:00 +0200 Subject: [PATCH] Fixed 239 - some of the settings are not saved --- iGlance/iGlance/iGlance/UserSettings.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iGlance/iGlance/iGlance/UserSettings.swift b/iGlance/iGlance/iGlance/UserSettings.swift index d8252bd..58fd481 100644 --- a/iGlance/iGlance/iGlance/UserSettings.swift +++ b/iGlance/iGlance/iGlance/UserSettings.swift @@ -177,7 +177,7 @@ struct BatterySettings: Codable { self.showBatteryIcon = showBatteryIcon } - if let decodedShowPercentage = try? container.decodeIfPresent(Bool.self, forKey: .showBatteryMenuBarItem) { + if let decodedShowPercentage = try? container.decodeIfPresent(Bool.self, forKey: .showPercentage) { self.showPercentage = decodedShowPercentage } @@ -225,8 +225,8 @@ struct IGlanceUserSettings: Codable { let container = try decoder.container(keyedBy: CodingKeys.self) // decode the keys, if they are not present use the default values - if let decodedAutostartOnBoot = try? container.decodeIfPresent(String.self, forKey: .autostartOnBoot) { - self.autostartOnBoot = decodedAutostartOnBoot.lowercased() == "true" + if let decodedAutostartOnBoot = try? container.decodeIfPresent(Bool.self, forKey: .autostartOnBoot) { + self.autostartOnBoot = decodedAutostartOnBoot } if let decodedAdvancedLogging = try? container.decodeIfPresent(Bool.self, forKey: .advancedLogging) { self.advancedLogging = decodedAdvancedLogging