fix issue when coins and txn fee got reseted after navigating back and forth
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionInfo.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionInfo.cs
@@ -45,6 +45,8 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
{
SubtractFee = default;
MaximumPossibleFeeRate = default;
+ Coins = Enumerable.Empty<SmartCoin>();
+ FeeRate = default;
}
}
}

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionPreviewViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionPreviewViewModel.cs
@@ -145,6 +145,8 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
}
private async Task<bool> InitialiseTransactionAsync()
+ {
+ if (!_info.Coins.Any())
{
var privacyControlDialogResult = await NavigateDialogAsync(new PrivacyControlViewModel(_wallet, _info, isSilent: true));
if (privacyControlDialogResult.Kind == DialogResultKind.Normal && privacyControlDialogResult.Result is { } coins)
@@ -155,7 +157,10 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
{
return false;
}
+ }
+ if (_info.FeeRate is null)
+ {
var feeDialogResult = await NavigateDialogAsync(new SendFeeViewModel(_wallet, _info, true));
if (feeDialogResult.Kind == DialogResultKind.Normal)
{
@@ -165,6 +170,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
{
return false;
}
+ }
return true;
}
@@ -211,14 +217,14 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
{
var currentFeeRate = transactionInfo.FeeRate;
var maxPossibleFeeRateInSatoshiPerByte = (currentFeeRate.SatoshiPerByte / percentageOfOverpayment) * 100;
- var maxPossibleFeeRate = new FeeRate(maxPossibleFeeRateInSatoshiPerByte);
- transactionInfo.FeeRate = maxPossibleFeeRate;
- transactionInfo.MaximumPossibleFeeRate = maxPossibleFeeRate;
+ transactionInfo.MaximumPossibleFeeRate = new FeeRate(maxPossibleFeeRateInSatoshiPerByte);
var feeChartViewModel = new FeeChartViewModel();
var feeEstimations = wallet.Network == Network.Main ? wallet.FeeProvider.AllFeeEstimate.Estimations : SendFeeViewModel.TestNetFeeEstimates;
feeChartViewModel.UpdateFeeEstimates(feeEstimations);
- var blockTarget = feeChartViewModel.GetConfirmationTarget(maxPossibleFeeRate);
+
+ var blockTarget = feeChartViewModel.GetConfirmationTarget(transactionInfo.MaximumPossibleFeeRate);
+ transactionInfo.FeeRate = new FeeRate(feeChartViewModel.GetSatoshiPerByte(blockTarget));
transactionInfo.ConfirmationTimeSpan = SendFeeViewModel.CalculateConfirmationTime(blockTarget);
}

fix issue when coins and txn fee got reseted after navigating back and forth