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

This commit is contained in:
OmarHatem 2022-12-08 00:11:09 +02:00
parent 55b37164dc
commit dac0b02c7d
2 changed files with 4 additions and 2 deletions

View file

@ -1,3 +1,4 @@
import 'package:cake_wallet/entities/fiat_api_mode.dart';
import 'package:mobx/mobx.dart';
import 'package:cake_wallet/core/fiat_conversion_service.dart';
import 'package:cake_wallet/store/dashboard/fiat_conversion_store.dart';
@ -12,7 +13,7 @@ void startCurrentFiatChangeReaction(AppStore appStore,
_onCurrentFiatCurrencyChangeDisposer?.reaction.dispose();
_onCurrentFiatCurrencyChangeDisposer = reaction(
(_) => settingsStore.fiatCurrency, (FiatCurrency fiatCurrency) async {
if (appStore.wallet == null) {
if (appStore.wallet == null || settingsStore.fiatApiMode == FiatApiMode.disabled) {
return;
}

View file

@ -1,3 +1,4 @@
import 'package:cake_wallet/entities/fiat_api_mode.dart';
import 'package:cake_wallet/entities/fiat_currency.dart';
import 'package:cake_wallet/entities/update_haven_rate.dart';
import 'package:cw_core/transaction_history.dart';
@ -87,7 +88,7 @@ void startCurrentWalletChangeReaction(AppStore appStore,
TransactionHistoryBase<TransactionInfo>, TransactionInfo>?
wallet) async {
try {
if (wallet == null) {
if (wallet == null || settingsStore.fiatApiMode == FiatApiMode.disabled) {
return;
}