Fix fee priority display (#540)

* Fix transaction priority displaying empty string

* Fix priority label with rate in send screen

* Make price nullable in transaction list items
This commit is contained in:
Omar Hatem 2022-10-20 00:24:50 +02:00 committed by GitHub
parent e011ab3e88
commit e1885e44a2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 7 deletions

View file

@ -53,7 +53,7 @@ class TransactionListItem extends ActionListItem with Keyable {
break;
case WalletType.haven:
final asset = haven!.assetOfTransaction(transaction);
final price = balanceViewModel.fiatConvertationStore.prices[asset]!;
final price = balanceViewModel.fiatConvertationStore.prices[asset];
amount = calculateFiatAmountRaw(
cryptoAmount: haven!.formatterMoneroAmountToDouble(amount: transaction.amount),
price: price);

View file

@ -1,6 +1,7 @@
import 'package:cake_wallet/entities/balance_display_mode.dart';
import 'package:cake_wallet/entities/transaction_description.dart';
import 'package:cake_wallet/view_model/dashboard/balance_view_model.dart';
import 'package:cw_bitcoin/bitcoin_transaction_priority.dart';
import 'package:cw_core/transaction_priority.dart';
import 'package:cake_wallet/view_model/send/output.dart';
import 'package:cake_wallet/view_model/send/send_template_view_model.dart';
@ -275,9 +276,7 @@ abstract class SendViewModelBase with Store {
if (isElectrumWallet) {
final rate = bitcoin!.getFeeRate(wallet, _priority);
// FIX-ME: labelWithRate
// return '${priority.labelWithRate(rate)}';
return '';
return '${(priority as BitcoinTransactionPriority).labelWithRate(rate)}';
}
return priority.toString();

View file

@ -1,6 +1,7 @@
import 'package:cake_wallet/entities/language_service.dart';
import 'package:cake_wallet/store/yat/yat_store.dart';
import 'package:cake_wallet/view_model/settings/choices_list_item.dart';
import 'package:cw_bitcoin/bitcoin_transaction_priority.dart';
import 'package:flutter/cupertino.dart';
import 'package:mobx/mobx.dart';
import 'package:package_info/package_info.dart';
@ -136,9 +137,7 @@ abstract class SettingsViewModelBase with Store {
if (wallet.type == WalletType.bitcoin
|| wallet.type == WalletType.litecoin) {
final rate = bitcoin!.getFeeRate(wallet, _priority);
// FIX-ME: BitcoinTransactionPriority
// return '${priority.labelWithRate(rate)}';
return '';
return '${(priority as BitcoinTransactionPriority).labelWithRate(rate)}';
}
return priority.toString();