diff options
| author | Fuwn <[email protected]> | 2025-07-24 19:04:00 +0200 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2025-07-24 19:04:00 +0200 |
| commit | f679f1126374149b8259e62493209f27edb200d6 (patch) | |
| tree | cc0c4a74e3275dc0988962fa31dbe31e574e9656 /Sora/Data/Settings | |
| parent | feat: Development commit (diff) | |
| download | sora-testing-f679f1126374149b8259e62493209f27edb200d6.tar.xz sora-testing-f679f1126374149b8259e62493209f27edb200d6.zip | |
feat: Development commit
Diffstat (limited to 'Sora/Data/Settings')
| -rw-r--r-- | Sora/Data/Settings/SettingsManager.swift | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Sora/Data/Settings/SettingsManager.swift b/Sora/Data/Settings/SettingsManager.swift index 44b3526..0d20dfa 100644 --- a/Sora/Data/Settings/SettingsManager.swift +++ b/Sora/Data/Settings/SettingsManager.swift @@ -224,9 +224,11 @@ class SettingsManager: ObservableObject { // swiftlint:disable:this type_body_l let key = credentials.provider let value = extract(credentials) - if dictionary[key] == nil { - dictionary[key] = value - } else if isDefault(dictionary[key]!) && !isDefault(value) { + if let existing = dictionary[key] { + if isDefault(existing) && !isDefault(value) { + dictionary[key] = value + } + } else { dictionary[key] = value } } |