Disable updating fiat rate if the option is disabled [skip ci]

OmarHatem committed Dec 8, 2022 at 00:11 UTC dac0b02c7dabaaacb59d853fb8d23fe19eaace88
2 files changed +4 -2
lib/reactions/on_current_fiat_change.dart
+2 -1
@@ -1,3 +1,4 @@
1 +import 'package:cake_wallet/entities/fiat_api_mode.dart';
2 import 'package:mobx/mobx.dart';
3 import 'package:cake_wallet/core/fiat_conversion_service.dart';
4 import 'package:cake_wallet/store/dashboard/fiat_conversion_store.dart';
@@ -12,7 +13,7 @@ void startCurrentFiatChangeReaction(AppStore appStore,
13 _onCurrentFiatCurrencyChangeDisposer?.reaction.dispose();
14 _onCurrentFiatCurrencyChangeDisposer = reaction(
15 (_) => settingsStore.fiatCurrency, (FiatCurrency fiatCurrency) async {
15 - if (appStore.wallet == null) {
16 + if (appStore.wallet == null || settingsStore.fiatApiMode == FiatApiMode.disabled) {
17 return;
18 }
19
lib/reactions/on_current_wallet_change.dart
+2 -1
@@ -1,3 +1,4 @@
1 +import 'package:cake_wallet/entities/fiat_api_mode.dart';
2 import 'package:cake_wallet/entities/fiat_currency.dart';
3 import 'package:cake_wallet/entities/update_haven_rate.dart';
4 import 'package:cw_core/transaction_history.dart';
@@ -87,7 +88,7 @@ void startCurrentWalletChangeReaction(AppStore appStore,
88 TransactionHistoryBase<TransactionInfo>, TransactionInfo>?
89 wallet) async {
90 try {
90 - if (wallet == null) {
91 + if (wallet == null || settingsStore.fiatApiMode == FiatApiMode.disabled) {
92 return;
93 }
94