Skip to content

Commit

Permalink
Fixed 239 - some of the settings are not saved
Browse files Browse the repository at this point in the history
  • Loading branch information
BartlomiejWlodarczak committed May 30, 2021
1 parent 33096b5 commit 58da713
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions iGlance/iGlance/iGlance/UserSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 58da713

Please sign in to comment.