mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-08 20:09:24 +00:00
[CW-233] Fix missing display balance setting
This commit is contained in:
parent
a82803de3a
commit
c67e8c5037
6 changed files with 27 additions and 15 deletions
|
@ -5,10 +5,10 @@ import 'package:cake_wallet/ionia/ionia_anypay.dart';
|
|||
import 'package:cake_wallet/ionia/ionia_gift_card.dart';
|
||||
import 'package:cake_wallet/ionia/ionia_tip.dart';
|
||||
import 'package:cake_wallet/src/screens/buy/onramper_page.dart';
|
||||
import 'package:cake_wallet/src/screens/setting/display_settings_page.dart';
|
||||
import 'package:cake_wallet/src/screens/setting/other_settings_page.dart';
|
||||
import 'package:cake_wallet/src/screens/setting/privacy_page.dart';
|
||||
import 'package:cake_wallet/src/screens/setting/security_backup_page.dart';
|
||||
import 'package:cake_wallet/src/screens/settings/display_settings_page.dart';
|
||||
import 'package:cake_wallet/src/screens/settings/other_settings_page.dart';
|
||||
import 'package:cake_wallet/src/screens/settings/privacy_page.dart';
|
||||
import 'package:cake_wallet/src/screens/settings/security_backup_page.dart';
|
||||
import 'package:cake_wallet/src/screens/ionia/cards/ionia_custom_redeem_page.dart';
|
||||
import 'package:cake_wallet/src/screens/ionia/cards/ionia_gift_card_detail_page.dart';
|
||||
import 'package:cake_wallet/src/screens/ionia/cards/ionia_more_options_page.dart';
|
||||
|
|
|
@ -5,10 +5,10 @@ import 'package:cake_wallet/src/screens/backup/edit_backup_password_page.dart';
|
|||
import 'package:cake_wallet/src/screens/buy/buy_webview_page.dart';
|
||||
import 'package:cake_wallet/src/screens/buy/onramper_page.dart';
|
||||
import 'package:cake_wallet/src/screens/buy/pre_order_page.dart';
|
||||
import 'package:cake_wallet/src/screens/setting/display_settings_page.dart';
|
||||
import 'package:cake_wallet/src/screens/setting/other_settings_page.dart';
|
||||
import 'package:cake_wallet/src/screens/setting/privacy_page.dart';
|
||||
import 'package:cake_wallet/src/screens/setting/security_backup_page.dart';
|
||||
import 'package:cake_wallet/src/screens/settings/display_settings_page.dart';
|
||||
import 'package:cake_wallet/src/screens/settings/other_settings_page.dart';
|
||||
import 'package:cake_wallet/src/screens/settings/privacy_page.dart';
|
||||
import 'package:cake_wallet/src/screens/settings/security_backup_page.dart';
|
||||
import 'package:cake_wallet/src/screens/ionia/cards/ionia_account_cards_page.dart';
|
||||
import 'package:cake_wallet/src/screens/ionia/cards/ionia_account_page.dart';
|
||||
import 'package:cake_wallet/src/screens/ionia/cards/ionia_custom_redeem_page.dart';
|
||||
|
|
|
@ -60,7 +60,7 @@ class DashboardPage extends BasePage {
|
|||
Widget middle(BuildContext context) {
|
||||
return SyncIndicator(dashboardViewModel: walletViewModel,
|
||||
onTap: () => Navigator.of(context, rootNavigator: true)
|
||||
.pushNamed(Routes.nodeList));
|
||||
.pushNamed(Routes.connectionSync));
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
|
@ -29,11 +29,11 @@ class DisplaySettingsPage extends BasePage {
|
|||
child: Column(
|
||||
children: [
|
||||
SettingsSwitcherCell(
|
||||
title: S.current.settings_save_recipient_address,
|
||||
value: settingsViewModel.shouldSaveRecipientAddress,
|
||||
onValueChange: (BuildContext _, bool value) {
|
||||
settingsViewModel.setShouldSaveRecipientAddress(value);
|
||||
}),
|
||||
title: S.current.settings_display_balance,
|
||||
value: settingsViewModel.shouldDisplayBalance,
|
||||
onValueChange: (_, bool value) {
|
||||
settingsViewModel.setShouldDisplayBalance(value);
|
||||
}),
|
||||
if (!isHaven)
|
||||
SettingsPickerCell<FiatCurrency>(
|
||||
title: S.current.settings_currency,
|
||||
|
|
|
@ -24,7 +24,7 @@ class OtherSettingsPage extends BasePage {
|
|||
return Container(
|
||||
padding: EdgeInsets.only(top: 10),
|
||||
child: Column(children: [
|
||||
SettingsPickerCell<TransactionPriority>(
|
||||
SettingsPickerCell(
|
||||
title: S.current.settings_fee_priority,
|
||||
items: priorityForWalletType(_settingsViewModel.walletType),
|
||||
displayItem: _settingsViewModel.getDisplayPriority,
|
||||
|
|
|
@ -116,6 +116,9 @@ abstract class SettingsViewModelBase with Store {
|
|||
BalanceDisplayMode get balanceDisplayMode =>
|
||||
_settingsStore.balanceDisplayMode;
|
||||
|
||||
@computed
|
||||
bool get shouldDisplayBalance => balanceDisplayMode == BalanceDisplayMode.displayableBalance;
|
||||
|
||||
@computed
|
||||
bool get shouldSaveRecipientAddress =>
|
||||
_settingsStore.shouldSaveRecipientAddress;
|
||||
|
@ -195,6 +198,15 @@ abstract class SettingsViewModelBase with Store {
|
|||
_settingsStore.currentTheme = newTheme;
|
||||
}
|
||||
|
||||
@action
|
||||
void setShouldDisplayBalance(bool value){
|
||||
if (value) {
|
||||
_settingsStore.balanceDisplayMode = BalanceDisplayMode.displayableBalance;
|
||||
} else {
|
||||
_settingsStore.balanceDisplayMode = BalanceDisplayMode.hiddenBalance;
|
||||
}
|
||||
}
|
||||
|
||||
String getDisplayPriority(dynamic priority) {
|
||||
final _priority = priority as TransactionPriority;
|
||||
|
||||
|
|
Loading…
Reference in a new issue