Skip to content

Commit

Permalink
Merge pull request #260 from BartlomiejWlodarczak/bug-fix/239-setting…
Browse files Browse the repository at this point in the history
…s-not-saved

Bug fix/239 settings not saved
  • Loading branch information
D0miH authored Jun 5, 2021
2 parents 33096b5 + 58da713 commit 875d9d2
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 875d9d2

Please sign in to comment.