From a1dd22232b93235dffa06d46fd81a9dba20353b9 Mon Sep 17 00:00:00 2001 From: Serhii Date: Thu, 8 Dec 2022 09:56:04 +0200 Subject: [PATCH] [skip ci] fix fiat settings display --- lib/src/screens/settings/display_settings_page.dart | 3 ++- lib/view_model/settings/display_settings_view_model.dart | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/src/screens/settings/display_settings_page.dart b/lib/src/screens/settings/display_settings_page.dart index cd413ff45..39123a7eb 100644 --- a/lib/src/screens/settings/display_settings_page.dart +++ b/lib/src/screens/settings/display_settings_page.dart @@ -34,7 +34,8 @@ class DisplaySettingsPage extends BasePage { onValueChange: (_, bool value) { _displaySettingsViewModel.setShouldDisplayBalance(value); }), - if (!isHaven) + //if (!isHaven) it does not work correctly + if(!_displaySettingsViewModel.disabledFiatApiMode) SettingsPickerCell( title: S.current.settings_currency, searchHintText: S.current.search_currency, diff --git a/lib/view_model/settings/display_settings_view_model.dart b/lib/view_model/settings/display_settings_view_model.dart index 4e73b3399..bac6d9994 100644 --- a/lib/view_model/settings/display_settings_view_model.dart +++ b/lib/view_model/settings/display_settings_view_model.dart @@ -3,6 +3,7 @@ import 'package:cake_wallet/entities/fiat_currency.dart'; import 'package:cake_wallet/store/settings_store.dart'; import 'package:cake_wallet/themes/theme_base.dart'; import 'package:mobx/mobx.dart'; +import 'package:cake_wallet/entities/fiat_api_mode.dart'; part 'display_settings_view_model.g.dart'; @@ -30,6 +31,9 @@ abstract class DisplaySettingsViewModelBase with Store { @computed ThemeBase get theme => _settingsStore.currentTheme; + @computed + bool get disabledFiatApiMode => _settingsStore.fiatApiMode == FiatApiMode.disabled; + @action void setBalanceDisplayMode(BalanceDisplayMode value) => _settingsStore.balanceDisplayMode = value;