Skip to content

Commit

Permalink
fix: handle preference files with deprecated keys
Browse files Browse the repository at this point in the history
  • Loading branch information
Louis Pontoise committed Nov 11, 2019
1 parent 95d8821 commit eabc327
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion alt-tab-macos/logic/Preferences.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ class Preferences {
}
rawValues = try loadFromDisk(userFile)
if preferencesExist {
rawValues = defaults.merging(rawValues) { (_, new) in new }
let compatiblePreferences = rawValues.filter { defaults[$0.key] != nil }
rawValues = defaults.merging(compatiblePreferences) { (_, new) in new }
}
try rawValues.forEach { try updateAndValidateFromString($0.key, $0.value) }
if preferencesExist {
Expand Down

0 comments on commit eabc327

Please # to comment.