mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-10 21:04:53 +00:00
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:
commit
e4bb14218b
1 changed files with 28 additions and 23 deletions
|
@ -79,14 +79,16 @@ abstract class SendViewModelBase with Store {
|
|||
double get estimatedFee {
|
||||
int amount;
|
||||
|
||||
try {
|
||||
if (cryptoAmount?.isNotEmpty ?? false) {
|
||||
final _cryptoAmount = cryptoAmount.replaceAll(',', '.');
|
||||
int _amount = 0;
|
||||
switch (walletType) {
|
||||
case WalletType.monero:
|
||||
_amount = moneroParseAmount(amount: cryptoAmount);
|
||||
_amount = moneroParseAmount(amount: _cryptoAmount);
|
||||
break;
|
||||
case WalletType.bitcoin:
|
||||
_amount = stringDoubleToBitcoinAmount(cryptoAmount);
|
||||
_amount = stringDoubleToBitcoinAmount(_cryptoAmount);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -107,6 +109,9 @@ abstract class SendViewModelBase with Store {
|
|||
if (_wallet is MoneroWallet) {
|
||||
return moneroAmountToDouble(amount: fee);
|
||||
}
|
||||
} catch (e) {
|
||||
print(e.toString());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue