Update currency.ts

This commit is contained in:
Marcos Rodriguez Velez 2024-04-20 22:24:28 -04:00
parent 09eb4cd3af
commit 7c5d4f0a60
No known key found for this signature in database
GPG Key ID: 6030B2F48CCE86D7

View File

@ -41,13 +41,12 @@ async function getPreferredCurrency(): Promise<FiatUnitType> {
if (preferredCurrency) {
const parsedPreferredCurrency = JSON.parse(preferredCurrency);
if (FiatUnit[parsedPreferredCurrency]) {
preferredFiatCurrency = FiatUnit[parsedPreferredCurrency];
await DefaultPreference.setName(GROUP_IO_BLUEWALLET);
await DefaultPreference.set(PREFERRED_CURRENCY_STORAGE_KEY, preferredFiatCurrency.endPointKey);
await DefaultPreference.set(PREFERRED_CURRENCY_LOCALE_STORAGE_KEY, preferredFiatCurrency.locale.replace('-', '_'));
return parsedPreferredCurrency;
}
preferredFiatCurrency = FiatUnit[parsedPreferredCurrency.endPointKey];
await DefaultPreference.setName(GROUP_IO_BLUEWALLET);
await DefaultPreference.set(PREFERRED_CURRENCY_STORAGE_KEY, preferredFiatCurrency.endPointKey);
await DefaultPreference.set(PREFERRED_CURRENCY_LOCALE_STORAGE_KEY, preferredFiatCurrency.locale.replace('-', '_'));
return preferredFiatCurrency;
}
return FiatUnit.USD;
}