add possibility to edit the custom fee
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/SendViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/SendViewModel.cs
@@ -102,7 +102,8 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
}
});
- AdvancedOptionsCommand = ReactiveCommand.Create(() => Navigate(NavigationTarget.CompactDialogScreen).To(new AdvancedSendOptionsViewModel(_transactionInfo)));
+ AdvancedOptionsCommand = ReactiveCommand.CreateFromTask(async () =>
+ await NavigateDialogAsync(new AdvancedSendOptionsViewModel(_transactionInfo), NavigationTarget.CompactDialogScreen));
var nextCommandCanExecute =
this.WhenAnyValue(x => x.AmountBtc, x => x.To).Select(_ => Unit.Default)

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionPreviewViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionPreviewViewModel.cs
@@ -37,6 +37,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
[AutoNotify] private bool _transactionHasChange;
[AutoNotify] private bool _transactionHasPockets;
[AutoNotify] private bool _adjustFeeAvailable;
+ [AutoNotify] private bool _isCustomFeeUsed;
public TransactionPreviewViewModel(Wallet wallet, TransactionInfo info)
{
@@ -67,7 +68,17 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
_nextButtonText = "Confirm";
}
- AdjustFeeCommand = ReactiveCommand.CreateFromTask(OnAdjustFeeAsync);
+ AdjustFeeCommand = ReactiveCommand.CreateFromTask(async () =>
+ {
+ if (_info.IsCustomFeeUsed)
+ {
+ await ShowAdvancedDialogAsync();
+ }
+ else
+ {
+ await OnAdjustFeeAsync();
+ }
+ });
AvoidChangeCommand = ReactiveCommand.CreateFromTask(OnAvoidChangeAsync);
@@ -82,14 +93,22 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
public bool IsPayJoin { get; }
- public bool IsCustomFeeUsed => _info.IsCustomFeeUsed;
-
public ICommand AdjustFeeCommand { get; }
public ICommand AvoidChangeCommand { get; }
public ICommand ChangePocketsCommand { get; }
+ private async Task ShowAdvancedDialogAsync()
+ {
+ var result = await NavigateDialogAsync(new AdvancedSendOptionsViewModel(_info), NavigationTarget.CompactDialogScreen);
+
+ if (result.Kind == DialogResultKind.Normal)
+ {
+ await BuildAndUpdateAsync();
+ }
+ }
+
private async Task OnExportPsbtAsync()
{
if (_transaction is { })
@@ -111,6 +130,12 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
{
_info.FeeRate = feeRateDialogResult.Result;
+ await BuildAndUpdateAsync();
+ }
+ }
+
+ private async Task BuildAndUpdateAsync()
+ {
var newTransaction = await BuildTransactionAsync();
if (newTransaction is { })
@@ -118,7 +143,6 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
UpdateTransaction(newTransaction);
}
}
- }
private async Task OnAvoidChangeAsync()
{
@@ -140,12 +164,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
{
_info.Coins = selectPocketsDialog.Result;
- var newTransaction = await BuildTransactionAsync();
-
- if (newTransaction is { })
- {
- UpdateTransaction(newTransaction);
- }
+ await BuildAndUpdateAsync();
}
}
@@ -298,6 +317,8 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
TransactionHasChange = _transaction.OuterWalletOutputs.Sum(x => x.Amount) > fee && _transaction.InnerWalletOutputs.Sum(x => x.Amount) > 0;
TransactionHasPockets = !_info.IsPrivatePocketUsed;
+
+ IsCustomFeeUsed = _info.IsCustomFeeUsed;
}
protected override void OnNavigatedTo(bool isInHistory, CompositeDisposable disposables)

MODIFY
WalletWasabi.Fluent/Views/Wallets/Send/TransactionPreviewView.axaml
WalletWasabi.Fluent/Views/Wallets/Send/TransactionPreviewView.axaml
DockPanel.Dock="Right"
Margin="10 0">
<Button.IsVisible>
- <MultiBinding Converter="{x:Static BoolConverters.And}">
+ <MultiBinding Converter="{x:Static BoolConverters.Or}">
<Binding Path="AdjustFeeAvailable" />
- <Binding Path="IsCustomFeeUsed" Converter="{x:Static BoolConverters.Not}" />
+ <Binding Path="IsCustomFeeUsed" />
</MultiBinding>
</Button.IsVisible>
<Viewbox Height="20">

add possibility to edit the custom fee