Init amount & transaction fee only if needed
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/SendViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/SendViewModel.cs
@@ -74,9 +74,6 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
.Skip(1)
.Subscribe(ParseToField);
- this.WhenAnyValue(x => x.AmountBtc)
- .Subscribe(x => _transactionInfo.Amount = new Money(x, MoneyUnit.BTC));
-
this.WhenAnyValue(x => x.PayJoinEndPoint)
.Subscribe(endPoint =>
{
@@ -119,6 +116,15 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
NextCommand = ReactiveCommand.Create(() =>
{
+ var amount = new Money(AmountBtc, MoneyUnit.BTC);
+
+ if (_transactionInfo.Amount != amount)
+ {
+ _transactionInfo.ResetAmountSpecificOptions();
+ }
+
+ _transactionInfo.Amount = amount;
+
Navigate().To(new TransactionPreviewViewModel(wallet, _transactionInfo));
}, nextCommandCanExecute);

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionInfo.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionInfo.cs
@@ -38,5 +38,12 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
public bool IsPrivatePocketUsed => Coins.All(x => x.HdPubKey.AnonymitySet >= _privateCoinThreshold);
public bool SubtractFee { get; set; }
+
+ public void ResetAmountSpecificOptions()
+ {
+ SubtractFee = 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)
{
@@ -166,6 +171,8 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
return false;
}
+ }
+
return true;
}

Init amount & transaction fee only if needed