FIX: Wrong key was being used for extensions

This commit is contained in:
Marcos Rodriguez Velez 2024-01-24 15:54:36 -04:00
parent a2e4157f1c
commit d9633237ef
No known key found for this signature in database
GPG Key ID: 6030B2F48CCE86D7
3 changed files with 3 additions and 3 deletions

View File

@ -56,7 +56,7 @@ class ComplicationController: NSObject, CLKComplicationDataSource {
valueLabel = price
timeLabel = lastUpdated
valueSmallLabel = priceAbbreviated
if let preferredFiatCurrency = groupUserDefaults?.string(forKey: "preferredFiatCurrency"), let preferredFiatUnit = fiatUnit(currency: preferredFiatCurrency) {
if let preferredFiatCurrency = groupUserDefaults?.string(forKey: "preferredCurrency"), let preferredFiatUnit = fiatUnit(currency: preferredFiatCurrency) {
currencySymbol = preferredFiatUnit.symbol
} else {
currencySymbol = fiatUnit(currency: "USD")!.symbol

View File

@ -20,7 +20,7 @@ class ExtensionDelegate: NSObject, WKExtensionDelegate {
static func preferredFiatCurrencyChanged() {
let fiatUnitUserDefaults: FiatUnit
let groupUserDefaults = UserDefaults(suiteName: UserDefaultsGroupKey.GroupName.rawValue)
if let preferredFiatCurrency = groupUserDefaults?.string(forKey: "preferredFiatCurrency"), let preferredFiatUnit = fiatUnit(currency: preferredFiatCurrency) {
if let preferredFiatCurrency = groupUserDefaults?.string(forKey: "preferredCurrency"), let preferredFiatUnit = fiatUnit(currency: preferredFiatCurrency) {
fiatUnitUserDefaults = preferredFiatUnit
} else {
fiatUnitUserDefaults = fiatUnit(currency: "USD")!

View File

@ -102,7 +102,7 @@ class WatchDataSource: NSObject {
func processData(data: [String: Any]) {
if let preferredFiatCurrency = data["preferredFiatCurrency"] as? String, let preferredFiatCurrencyUnit = fiatUnit(currency: preferredFiatCurrency) {
groupUserDefaults?.set(preferredFiatCurrencyUnit.endPointKey, forKey: "preferredFiatCurrency")
groupUserDefaults?.set(preferredFiatCurrencyUnit.endPointKey, forKey: "preferredCurrency")
groupUserDefaults?.synchronize()
ExtensionDelegate.preferredFiatCurrencyChanged()
} else if let isWalletsInitialized = data["isWalletsInitialized"] as? Bool {