fix back navigation in send process.
MODIFY
WalletWasabi.Fluent/ViewModels/Dialogs/Authorization/AuthorizationDialogBase.cs
WalletWasabi.Fluent/ViewModels/Dialogs/Authorization/AuthorizationDialogBase.cs
@@ -8,8 +8,6 @@ namespace WalletWasabi.Fluent.ViewModels.Dialogs.Authorization
{
protected AuthorizationDialogBase()
{
- BackCommand = ReactiveCommand.Create(() => Close(DialogResultKind.Back));
- CancelCommand = ReactiveCommand.Create(() => Close(DialogResultKind.Cancel));
NextCommand = ReactiveCommand.CreateFromTask(async () =>
{
var result = await Authorize();

MODIFY
WalletWasabi.Fluent/ViewModels/Dialogs/Base/DialogViewModelBaseOfTResult.cs
WalletWasabi.Fluent/ViewModels/Dialogs/Base/DialogViewModelBaseOfTResult.cs
@@ -25,6 +25,8 @@ namespace WalletWasabi.Fluent.ViewModels.Dialogs.Base
.DistinctUntilChanged()
.Subscribe(OnIsDialogOpenChanged);
+ BackCommand = ReactiveCommand.Create(() => Close(DialogResultKind.Back));
+
CancelCommand = ReactiveCommand.Create(() => Close(DialogResultKind.Cancel));
}

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionPreviewViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionPreviewViewModel.cs
@@ -112,21 +112,31 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
public ICommand AvoidChangeCommand { get; }
- private async Task InitialiseTransactionAsync()
+ private async Task<bool> InitialiseTransactionAsync()
{
var transactionInfo = _info;
var privacyControlDialogResult = await NavigateDialogAsync(new PrivacyControlViewModel(_wallet, transactionInfo, isSilent: true));
- if (privacyControlDialogResult.Result is { } coins)
+ if (privacyControlDialogResult.Kind == DialogResultKind.Normal && privacyControlDialogResult.Result is { } coins)
{
transactionInfo.Coins = coins;
}
+ else if (privacyControlDialogResult.Kind != DialogResultKind.Normal)
+ {
+ return false;
+ }
var feeDialogResult = await NavigateDialogAsync(new SendFeeViewModel(_wallet, transactionInfo, true));
if (feeDialogResult.Kind == DialogResultKind.Normal)
{
transactionInfo.FeeRate = feeDialogResult.Result;
}
+ else
+ {
+ return false;
+ }
+
+ return true;
}
private async Task<BuildTransactionResult?> BuildTransactionAsync()
@@ -257,7 +267,8 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
{
RxApp.MainThreadScheduler.Schedule(async () =>
{
- await InitialiseTransactionAsync();
+ if (await InitialiseTransactionAsync())
+ {
var initialTransaction = await BuildTransactionAsync();
@@ -265,6 +276,11 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
{
UpdateTransaction(initialTransaction);
}
+ }
+ else
+ {
+ Navigate().Back();
+ }
});
}
}

fix back navigation in send process.