From fea5234f25d4dc0df6fae3f938f5a1f5459d94fe Mon Sep 17 00:00:00 2001 From: oleksandrK Date: Tue, 17 Oct 2023 14:27:02 +0200 Subject: [PATCH] Added some improvements. --- src/Pages/Wallets.razor | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/Pages/Wallets.razor b/src/Pages/Wallets.razor index ef3cc306..63517490 100644 --- a/src/Pages/Wallets.razor +++ b/src/Pages/Wallets.razor @@ -425,7 +425,7 @@ - + Transfer funds to another wallet @@ -469,10 +469,10 @@ - Current balance: @_sourceWalletBalance + @($"Current balance: {_sourceWalletBalance:F8}"); - Balance after transfer: @CalculateAmountWalletSourceAfterTransaction():f8 BTC (@Math.Round(PriceConversionService.BtcToUsdConversion(_sourceBalanceAfterTransaction, _btcPrice), 2) USD) + @($"Balance after transfer: {CalculateAmountWalletSourceAfterTransaction():F8} BTC ({Math.Round(PriceConversionService.BtcToUsdConversion(_sourceBalanceAfterTransaction, _btcPrice), 2)} USD)") @@ -495,10 +495,10 @@ - @($"Current balance: {_transferTargetWalletBalance}") + @($"Current balance: {_transferTargetWalletBalance:f8}") - @($"Balance after transfer: {(CalculateAmountWalletTargetAfterTransaction()):f8} BTC ({Math.Round(PriceConversionService.BtcToUsdConversion((decimal)(targetBalance + _amountToTransfer), _btcPrice), 2)} USD)") + @($"Balance after transfer: {CalculateAmountWalletTargetAfterTransaction():F8} BTC ({Math.Round(PriceConversionService.BtcToUsdConversion((decimal)(targetBalance + _amountToTransfer), _btcPrice), 2)} USD)") @@ -713,11 +713,8 @@ private decimal CalculateAmountWalletTargetAfterTransaction() { - if (_transferAllFunds) - { - return targetBalance + _sourceBalance; - } - return targetBalance + _amountToTransfer; + decimal amount = _transferAllFunds ? targetBalance + _sourceBalance : targetBalance + _amountToTransfer; + return amount; } private decimal CalculateAmountWalletSourceAfterTransaction() @@ -1072,6 +1069,8 @@ _transferTargetWalletBalance = string.Empty; _sourceTransferWallet = wallet; _targetTransferWallet = null; + _selectedTransferWalletId = 0; + _amountToTransfer = Constants.MINIMUM_WITHDRAWAL_BTC_AMOUNT; (_sourceBalance,_) = await BitcoinService.GetWalletConfirmedBalance(wallet); _sourceWalletBalance = $"{_sourceBalance:f8} BTC ({Math.Round(PriceConversionService.BtcToUsdConversion((decimal) _sourceBalance, _btcPrice), 2)} USD)";