Ask for label on the first page
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/SendViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/SendViewModel.cs
@@ -109,13 +109,22 @@ public partial class SendViewModel : RoutableViewModel
return allFilled && !hasError;
});
- NextCommand = ReactiveCommand.Create(() =>
+ NextCommand = ReactiveCommand.CreateFromTask(async () =>
{
var address = BitcoinAddress.Create(To, wallet.Network);
_transactionInfo.Reset();
_transactionInfo.Amount = new Money(AmountBtc, MoneyUnit.BTC);
+ var labelDialog = new LabelEntryDialogViewModel(_wallet, _transactionInfo);
+ var result = await NavigateDialogAsync(labelDialog, NavigationTarget.CompactDialogScreen);
+ if (result.Result is not { } label)
+ {
+ return;
+ }
+
+ _transactionInfo.UserLabels = label;
+
Navigate().To(new TransactionPreviewViewModel(wallet, _transactionInfo, address, _isFixedAmount));
}, nextCommandCanExecute);
}

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionPreviewViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionPreviewViewModel.cs
@@ -460,27 +460,12 @@ public partial class TransactionPreviewViewModel : RoutableViewModel
private async Task OnConfirmAsync()
{
_cancellationTokenSource.Cancel();
- var labelDialog = new LabelEntryDialogViewModel(_wallet, _info);
-
- Navigate(NavigationTarget.CompactDialogScreen).To(labelDialog);
-
- var result = await labelDialog.GetDialogResultAsync();
-
- if (result.Result is null)
- {
- Navigate(NavigationTarget.CompactDialogScreen).Back(); // manually close the LabelEntryDialog when user cancels it. TODO: refactor.
- return;
- }
-
- _info.UserLabels = result.Result;
var transaction = await Task.Run(() => TransactionHelpers.BuildTransaction(_wallet, _info, _destination));
var transactionAuthorizationInfo = new TransactionAuthorizationInfo(transaction);
var authResult = await AuthorizeAsync(transactionAuthorizationInfo);
if (authResult)
{
- Navigate(NavigationTarget.CompactDialogScreen).Back(); // manually close the LabelEntryDialog when the authorization dialog never popped (empty password case). TODO: refactor.
-
IsBusy = true;
try

Ask for label on the first page