fiat fixes 2

This commit is contained in:
Matthew Fosse 2024-03-01 14:21:25 -08:00
parent 12b8d54426
commit ae42bf53d2

View file

@ -29,13 +29,6 @@ Future<void> startFiatRateUpdate(
if (appStore.wallet!.type == WalletType.haven) { if (appStore.wallet!.type == WalletType.haven) {
await updateHavenRate(fiatConversionStore); await updateHavenRate(fiatConversionStore);
} else if (appStore.wallet!.type == WalletType.lightning) {
fiatConversionStore.prices[appStore.wallet!.currency] =
await FiatConversionService.fetchPrice(
crypto: appStore.wallet!.currency,
fiat: settingsStore.fiatCurrency,
torOnly: settingsStore.fiatApiMode == FiatApiMode.torOnly) /
100000000;
} else { } else {
fiatConversionStore.prices[appStore.wallet!.currency] = fiatConversionStore.prices[appStore.wallet!.currency] =
await FiatConversionService.fetchPrice( await FiatConversionService.fetchPrice(
@ -61,7 +54,7 @@ Future<void> startFiatRateUpdate(
} }
if (appStore.wallet!.type == WalletType.lightning) { if (appStore.wallet!.type == WalletType.lightning) {
currencies = [CryptoCurrency.btc]; currencies = [CryptoCurrency.btc, CryptoCurrency.btcln];
} }
if (currencies != null) { if (currencies != null) {
@ -75,10 +68,9 @@ Future<void> startFiatRateUpdate(
} }
} }
if (appStore.wallet!.type == WalletType.lightning) { // keep btcln price in sync with btc:
fiatConversionStore.prices[CryptoCurrency.btcln] = fiatConversionStore.prices[CryptoCurrency.btcln] =
(fiatConversionStore.prices[CryptoCurrency.btc] ?? 0) / 100000000; (fiatConversionStore.prices[CryptoCurrency.btc] ?? 0) / 100000000;
}
} catch (e) { } catch (e) {
print(e); print(e);
} }