Don't navigate on wrong password entry
MODIFY
WalletWasabi.Fluent/ViewModels/Dialogs/Authorization/AuthorizationDialogBase.cs
WalletWasabi.Fluent/ViewModels/Dialogs/Authorization/AuthorizationDialogBase.cs
@@ -11,7 +11,10 @@ public abstract class AuthorizationDialogBase : DialogViewModelBase<bool>
NextCommand = ReactiveCommand.CreateFromTask(async () =>
{
var result = await Authorize();
+ if (result)
+ {
Close(DialogResultKind.Normal, result);
+ }
});
EnableAutoBusyOn(NextCommand);

MODIFY
WalletWasabi.Fluent/ViewModels/Dialogs/Authorization/PasswordAuthDialogViewModel.cs
WalletWasabi.Fluent/ViewModels/Dialogs/Authorization/PasswordAuthDialogViewModel.cs
+using System.Reactive.Concurrency;
+using System.Reactive.Linq;
using System.Threading.Tasks;
+using WalletWasabi.Fluent.Validation;
using WalletWasabi.Userfacing;
using WalletWasabi.Wallets;
@@ -9,6 +12,7 @@ public partial class PasswordAuthDialogViewModel : AuthorizationDialogBase
{
private readonly Wallet _wallet;
[AutoNotify] private string _password;
+ [AutoNotify] private string _errorMessage;
public PasswordAuthDialogViewModel(Wallet wallet)
{
@@ -32,6 +36,13 @@ public partial class PasswordAuthDialogViewModel : AuthorizationDialogBase
protected override async Task<bool> Authorize()
{
- return await Task.Run(() => PasswordHelper.TryPassword(_wallet.KeyManager, Password, out _));
+ var result = await Task.Run(() => PasswordHelper.TryPassword(_wallet.KeyManager, Password, out _));
+
+ if (!result)
+ {
+ ErrorMessage = "The password is incorrect! Try Again.";
+ }
+
+ return result;
}
}

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/WalletViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/WalletViewModel.cs
@@ -133,14 +133,9 @@ public partial class WalletViewModel : WalletViewModelBase
if (!string.IsNullOrEmpty(wallet.Kitchen.SaltSoup()))
{
var pwAuthDialog = new PasswordAuthDialogViewModel(wallet);
- var res = await NavigateDialogAsync(pwAuthDialog, NavigationTarget.CompactDialogScreen);
+ var dialogResult = await NavigateDialogAsync(pwAuthDialog, NavigationTarget.CompactDialogScreen);
- if (!res.Result && res.Kind == DialogResultKind.Normal)
- {
- await ShowErrorAsync("Wallet Info", "The password is incorrect! Try Again.", "");
- return;
- }
- else if (res.Kind is DialogResultKind.Back or DialogResultKind.Cancel)
+ if (!dialogResult.Result)
{
return;
}

Don't navigate on wrong password entry