From d9633237efe4039eff3744a947020b74388600d4 Mon Sep 17 00:00:00 2001 From: Marcos Rodriguez Velez Date: Wed, 24 Jan 2024 15:54:36 -0400 Subject: [PATCH] FIX: Wrong key was being used for extensions --- ios/BlueWalletWatch Extension/ComplicationController.swift | 2 +- ios/BlueWalletWatch Extension/ExtensionDelegate.swift | 2 +- ios/BlueWalletWatch Extension/Objects/WatchDataSource.swift | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ios/BlueWalletWatch Extension/ComplicationController.swift b/ios/BlueWalletWatch Extension/ComplicationController.swift index 278ea029d..184f6ff54 100644 --- a/ios/BlueWalletWatch Extension/ComplicationController.swift +++ b/ios/BlueWalletWatch Extension/ComplicationController.swift @@ -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 diff --git a/ios/BlueWalletWatch Extension/ExtensionDelegate.swift b/ios/BlueWalletWatch Extension/ExtensionDelegate.swift index f42a99cbf..b477b2281 100644 --- a/ios/BlueWalletWatch Extension/ExtensionDelegate.swift +++ b/ios/BlueWalletWatch Extension/ExtensionDelegate.swift @@ -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")! diff --git a/ios/BlueWalletWatch Extension/Objects/WatchDataSource.swift b/ios/BlueWalletWatch Extension/Objects/WatchDataSource.swift index e4be15f3c..172717de6 100644 --- a/ios/BlueWalletWatch Extension/Objects/WatchDataSource.swift +++ b/ios/BlueWalletWatch Extension/Objects/WatchDataSource.swift @@ -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 {