CAKE-137
M committed
Oct 30, 2020 at 15:56 UTC
ed72cee3f4f0f5ac577ac5517cd88d1365ba98c3
2 files changed
+6
-6
lib/reactions/bootstrap.dart
+1
-1
@@ -31,6 +31,6 @@ Future<void> bootstrap(GlobalKey<NavigatorState> navigatorKey) async {
31
startAuthenticationStateChange(authenticationStore, navigatorKey);
32
startCurrentWalletChangeReaction(
33
appStore, settingsStore, fiatConversionStore);
34
- startCurrentFiatChangeReaction(appStore, settingsStore);
34
+ startCurrentFiatChangeReaction(appStore, settingsStore, fiatConversionStore);
35
startOnCurrentNodeChangeReaction(appStore);
36
}
lib/reactions/on_current_fiat_change.dart
+5
-5
@@ -1,18 +1,18 @@
1
import 'package:mobx/mobx.dart';
2
+import 'package:cake_wallet/core/fiat_conversion_service.dart';
3
+import 'package:cake_wallet/store/dashboard/fiat_conversion_store.dart';
4
import 'package:cake_wallet/store/settings_store.dart';
5
import 'package:cake_wallet/store/app_store.dart';
6
import 'package:cake_wallet/entities/fiat_currency.dart';
7
8
ReactionDisposer _onCurrentFiatCurrencyChangeDisposer;
9
8
-void startCurrentFiatChangeReaction(AppStore appStore, SettingsStore settingsStore) {
10
+void startCurrentFiatChangeReaction(AppStore appStore, SettingsStore settingsStore, FiatConversionStore fiatConversionStore) {
11
_onCurrentFiatCurrencyChangeDisposer?.reaction?.dispose();
12
_onCurrentFiatCurrencyChangeDisposer = reaction(
13
(_) => settingsStore.fiatCurrency, (FiatCurrency fiatCurrency) async {
14
final cryptoCurrency = appStore.wallet.currency;
13
- // final price = await fiatConvertationService.getPrice(
14
- // crypto: cryptoCurrency, fiat: fiatCurrency);
15
- //
16
- // fiatConvertationStore.setPrice(price);
15
+ fiatConversionStore.price = await FiatConversionService.fetchPrice(
16
+ cryptoCurrency, settingsStore.fiatCurrency);
17
});
18
}
\ No newline at end of file