Merge pull request #100 from cake-tech/CAKE-299-UI-fixes-on-the-send-screen

CAKE-299 | fixed bug for estimatedFee getter in the send_view_model.dart
This commit is contained in:
M 2021-03-29 21:22:55 +03:00
commit e4bb14218b

View file

@ -79,14 +79,16 @@ abstract class SendViewModelBase with Store {
double get estimatedFee { double get estimatedFee {
int amount; int amount;
try {
if (cryptoAmount?.isNotEmpty ?? false) { if (cryptoAmount?.isNotEmpty ?? false) {
final _cryptoAmount = cryptoAmount.replaceAll(',', '.');
int _amount = 0; int _amount = 0;
switch (walletType) { switch (walletType) {
case WalletType.monero: case WalletType.monero:
_amount = moneroParseAmount(amount: cryptoAmount); _amount = moneroParseAmount(amount: _cryptoAmount);
break; break;
case WalletType.bitcoin: case WalletType.bitcoin:
_amount = stringDoubleToBitcoinAmount(cryptoAmount); _amount = stringDoubleToBitcoinAmount(_cryptoAmount);
break; break;
default: default:
break; break;
@ -107,6 +109,9 @@ abstract class SendViewModelBase with Store {
if (_wallet is MoneroWallet) { if (_wallet is MoneroWallet) {
return moneroAmountToDouble(amount: fee); return moneroAmountToDouble(amount: fee);
} }
} catch (e) {
print(e.toString());
}
return 0; return 0;
} }