diff --git a/lib/reactions/bootstrap.dart b/lib/reactions/bootstrap.dart index fef73c46..cfa6bf32 100644 --- a/lib/reactions/bootstrap.dart +++ b/lib/reactions/bootstrap.dart @@ -31,6 +31,6 @@ Future bootstrap(GlobalKey navigatorKey) async { startAuthenticationStateChange(authenticationStore, navigatorKey); startCurrentWalletChangeReaction( appStore, settingsStore, fiatConversionStore); - startCurrentFiatChangeReaction(appStore, settingsStore); + startCurrentFiatChangeReaction(appStore, settingsStore, fiatConversionStore); startOnCurrentNodeChangeReaction(appStore); } diff --git a/lib/reactions/on_current_fiat_change.dart b/lib/reactions/on_current_fiat_change.dart index 50207b74..794323dc 100644 --- a/lib/reactions/on_current_fiat_change.dart +++ b/lib/reactions/on_current_fiat_change.dart @@ -1,18 +1,18 @@ import 'package:mobx/mobx.dart'; +import 'package:cake_wallet/core/fiat_conversion_service.dart'; +import 'package:cake_wallet/store/dashboard/fiat_conversion_store.dart'; import 'package:cake_wallet/store/settings_store.dart'; import 'package:cake_wallet/store/app_store.dart'; import 'package:cake_wallet/entities/fiat_currency.dart'; ReactionDisposer _onCurrentFiatCurrencyChangeDisposer; -void startCurrentFiatChangeReaction(AppStore appStore, SettingsStore settingsStore) { +void startCurrentFiatChangeReaction(AppStore appStore, SettingsStore settingsStore, FiatConversionStore fiatConversionStore) { _onCurrentFiatCurrencyChangeDisposer?.reaction?.dispose(); _onCurrentFiatCurrencyChangeDisposer = reaction( (_) => settingsStore.fiatCurrency, (FiatCurrency fiatCurrency) async { final cryptoCurrency = appStore.wallet.currency; - // final price = await fiatConvertationService.getPrice( - // crypto: cryptoCurrency, fiat: fiatCurrency); - // - // fiatConvertationStore.setPrice(price); + fiatConversionStore.price = await FiatConversionService.fetchPrice( + cryptoCurrency, settingsStore.fiatCurrency); }); } \ No newline at end of file