From ae42bf53d2c3cfa58e257f3c7bfcce123a9c013a Mon Sep 17 00:00:00 2001 From: Matthew Fosse Date: Fri, 1 Mar 2024 14:21:25 -0800 Subject: [PATCH] fiat fixes 2 --- lib/reactions/fiat_rate_update.dart | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/lib/reactions/fiat_rate_update.dart b/lib/reactions/fiat_rate_update.dart index 4d9722ad0..e9f21f991 100644 --- a/lib/reactions/fiat_rate_update.dart +++ b/lib/reactions/fiat_rate_update.dart @@ -29,13 +29,6 @@ Future startFiatRateUpdate( if (appStore.wallet!.type == WalletType.haven) { 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 { fiatConversionStore.prices[appStore.wallet!.currency] = await FiatConversionService.fetchPrice( @@ -61,7 +54,7 @@ Future startFiatRateUpdate( } if (appStore.wallet!.type == WalletType.lightning) { - currencies = [CryptoCurrency.btc]; + currencies = [CryptoCurrency.btc, CryptoCurrency.btcln]; } if (currencies != null) { @@ -75,10 +68,9 @@ Future startFiatRateUpdate( } } - if (appStore.wallet!.type == WalletType.lightning) { - fiatConversionStore.prices[CryptoCurrency.btcln] = - (fiatConversionStore.prices[CryptoCurrency.btc] ?? 0) / 100000000; - } + // keep btcln price in sync with btc: + fiatConversionStore.prices[CryptoCurrency.btcln] = + (fiatConversionStore.prices[CryptoCurrency.btc] ?? 0) / 100000000; } catch (e) { print(e); }