From 91fd0e82619af6a2653fc953747c3b08b1eec2f8 Mon Sep 17 00:00:00 2001 From: M Date: Thu, 17 Dec 2020 22:50:26 +0200 Subject: [PATCH] Fixes(1). --- ios/Runner.xcodeproj/project.pbxproj | 6 +++--- lib/bitcoin/bitcoin_balance.dart | 4 +++- lib/bitcoin/bitcoin_wallet.dart | 4 ++-- .../dashboard/widgets/address_page.dart | 20 ++++++++++--------- .../wallet_address_list_view_model.dart | 8 ++++++-- 5 files changed, 25 insertions(+), 17 deletions(-) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 51d11dae5..ab6767c8d 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -354,7 +354,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = 5; + CURRENT_PROJECT_VERSION = 7; DEVELOPMENT_TEAM = 32J6BB6VUS; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -494,7 +494,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = 5; + CURRENT_PROJECT_VERSION = 7; DEVELOPMENT_TEAM = 32J6BB6VUS; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -528,7 +528,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = 5; + CURRENT_PROJECT_VERSION = 7; DEVELOPMENT_TEAM = 32J6BB6VUS; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( diff --git a/lib/bitcoin/bitcoin_balance.dart b/lib/bitcoin/bitcoin_balance.dart index 96340d34b..1515b06ac 100644 --- a/lib/bitcoin/bitcoin_balance.dart +++ b/lib/bitcoin/bitcoin_balance.dart @@ -27,7 +27,9 @@ class BitcoinBalance extends Balance { final int confirmed; final int unconfirmed; - int get total => confirmed + unconfirmed; + int get total => + (confirmed < 0 ? confirmed * -1 : confirmed) + + (unconfirmed < 0 ? unconfirmed * -1 : unconfirmed); String get confirmedFormatted => bitcoinAmountToString(amount: confirmed); diff --git a/lib/bitcoin/bitcoin_wallet.dart b/lib/bitcoin/bitcoin_wallet.dart index 0eca71b5b..eaf5d2864 100644 --- a/lib/bitcoin/bitcoin_wallet.dart +++ b/lib/bitcoin/bitcoin_wallet.dart @@ -389,9 +389,9 @@ abstract class BitcoinWalletBase extends WalletBase with Store { case TransactionPriority.slow: return 6000; case TransactionPriority.regular: - return 9000; + return 22080; case TransactionPriority.fast: - return 15000; + return 24000; default: return 0; } diff --git a/lib/src/screens/dashboard/widgets/address_page.dart b/lib/src/screens/dashboard/widgets/address_page.dart index c6bb46390..68ed7c6f2 100644 --- a/lib/src/screens/dashboard/widgets/address_page.dart +++ b/lib/src/screens/dashboard/widgets/address_page.dart @@ -3,6 +3,7 @@ import 'package:cake_wallet/view_model/wallet_address_list/wallet_address_list_v import 'package:cake_wallet/src/screens/receive/widgets/qr_widget.dart'; import 'package:cake_wallet/routes.dart'; import 'package:cake_wallet/generated/i18n.dart'; +import 'package:flutter_mobx/flutter_mobx.dart'; class AddressPage extends StatelessWidget { AddressPage({@required this.addressListViewModel}); @@ -35,15 +36,16 @@ class AddressPage extends StatelessWidget { mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text( - addressListViewModel.hasAccounts - ? S.of(context).accounts_subaddresses - : S.of(context).addresses, - style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.w500, - color: Colors.white), - ), + Observer( + builder: (_) => Text( + addressListViewModel.hasAccounts + ? S.of(context).accounts_subaddresses + : S.of(context).addresses, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w500, + color: Colors.white), + )), Icon( Icons.arrow_forward_ios, size: 14, diff --git a/lib/view_model/wallet_address_list/wallet_address_list_view_model.dart b/lib/view_model/wallet_address_list/wallet_address_list_view_model.dart index aca1ef808..738904891 100644 --- a/lib/view_model/wallet_address_list/wallet_address_list_view_model.dart +++ b/lib/view_model/wallet_address_list/wallet_address_list_view_model.dart @@ -57,10 +57,13 @@ class BitcoinURI extends PaymentURI { abstract class WalletAddressListViewModelBase with Store { WalletAddressListViewModelBase( {@required AppStore appStore}) { - hasAccounts = _wallet is MoneroWallet; _appStore = appStore; _wallet = _appStore.wallet; - _onWalletChangeReaction = reaction((_) => _appStore.wallet, (WalletBase wallet) => _wallet = wallet); + hasAccounts = _wallet?.type == WalletType.monero; + _onWalletChangeReaction = reaction((_) => _appStore.wallet, (WalletBase wallet) { + _wallet = wallet; + hasAccounts = _wallet.type == WalletType.monero; + }); _init(); } @@ -125,6 +128,7 @@ abstract class WalletAddressListViewModelBase with Store { return addressList; } + @observable bool hasAccounts; @observable