Skip to content

Commit

Permalink
Merge pull request #26610 from brave/ios-shortcut-button-migration-fix
Browse files Browse the repository at this point in the history
[iOS] Fallback to default value correctly for optional preferences
  • Loading branch information
kylehickinson authored Nov 18, 2024
2 parents 3d68550 + c69422e commit 436618c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ios/brave-ios/Sources/Preferences/Preferences.swift
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ extension Preferences.Option where ValueType: ExpressibleByNilLiteral {
defaultValue: ValueType,
container: UserDefaults
) where V: UserDefaultsEncodable, ValueType == V? {
let initialValue = (container.value(forKey: key) as? ValueType) ?? defaultValue
let initialValue = (container.value(forKey: key) as? V) ?? defaultValue
self.init(
key: key,
initialValue: initialValue,
Expand Down

0 comments on commit 436618c

Please sign in to comment.