Skip to content

Commit

Permalink
[iOS] Fallback to default value correctly for optional preferences (u…
Browse files Browse the repository at this point in the history
…plift to 1.74.x) (#26615)

Uplift of #26610 (squashed) to beta
  • Loading branch information
brave-builds authored Nov 19, 2024
1 parent 0e56a63 commit 16d5e10
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 16d5e10

Please sign in to comment.