remove unnecessary `cancel` logic
MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/RecoverWalletViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWallet/RecoverWalletViewModel.cs
@@ -85,8 +85,6 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet
});
Navigate().To(new AddedWalletPageViewModel(keyManager));
-
- return;
}
catch (Exception ex)
{
@@ -94,11 +92,6 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet
Logger.LogError(ex);
}
}
-
- if (dialogResult.Kind == DialogResultKind.Cancel)
- {
- Navigate().Clear();
- }
}
private async Task OnAdvancedRecoveryOptionsDialogAsync()

MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/SelectWalletCreationOptionViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWallet/SelectWalletCreationOptionViewModel.cs
@@ -75,7 +75,7 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet
private async Task OnCreateWalletAsync(string walletName)
{
var dialogResult = await NavigateDialogAsync(
- new CreatePasswordDialogViewModel("Type the password of the wallet.", enableEmpty: true, enableCancel: Services.WalletManager.HasWallet())
+ new CreatePasswordDialogViewModel("Type the password of the wallet.", enableEmpty: true)
, NavigationTarget.CompactDialogScreen);
if (dialogResult.Result is { } password)

MODIFY
WalletWasabi.Fluent/ViewModels/Dialogs/CreatePasswordDialogViewModel.cs
WalletWasabi.Fluent/ViewModels/Dialogs/CreatePasswordDialogViewModel.cs
@@ -11,14 +11,11 @@ namespace WalletWasabi.Fluent.ViewModels.Dialogs
[NavigationMetaData(Title = "Password")]
public partial class CreatePasswordDialogViewModel : DialogViewModelBase<string?>
{
- private readonly bool _enableCancel;
-
[AutoNotify] private string? _confirmPassword;
[AutoNotify] private string? _password;
- public CreatePasswordDialogViewModel(string caption, bool enableEmpty = true, bool enableCancel = true)
+ public CreatePasswordDialogViewModel(string caption, bool enableEmpty = true)
{
- _enableCancel = enableCancel;
Caption = caption;
// This means pressing continue will make the password empty string.
@@ -28,6 +25,7 @@ namespace WalletWasabi.Fluent.ViewModels.Dialogs
this.ValidateProperty(x => x.Password, ValidatePassword);
this.ValidateProperty(x => x.ConfirmPassword, ValidateConfirmPassword);
+ SetupCancel(enableCancel: true, enableCancelOnEscape: true, enableCancelOnPressed: true);
EnableBack = false;
var backCommandCanExecute = this.WhenAnyValue(x => x.IsDialogOpen).ObserveOn(RxApp.MainThreadScheduler);
@@ -85,12 +83,5 @@ namespace WalletWasabi.Fluent.ViewModels.Dialogs
errors.Add(ErrorSeverity.Error, PasswordHelper.PasswordTooLongMessage);
}
}
-
- protected override void OnNavigatedTo(bool isInHistory, CompositeDisposable disposables)
- {
- base.OnNavigatedTo(isInHistory, disposables);
-
- SetupCancel(enableCancel: _enableCancel, enableCancelOnEscape: _enableCancel, enableCancelOnPressed: false);
- }
}
}

MODIFY
WalletWasabi.Fluent/ViewModels/Login/PasswordFinder/PasswordFinderIntroduceViewModel.cs
WalletWasabi.Fluent/ViewModels/Login/PasswordFinder/PasswordFinderIntroduceViewModel.cs
using System.Threading.Tasks;
using ReactiveUI;
using WalletWasabi.Fluent.ViewModels.Dialogs;
-using WalletWasabi.Fluent.ViewModels.Dialogs.Base;
using WalletWasabi.Fluent.ViewModels.Navigation;
using WalletWasabi.Wallets;
using WalletWasabi.Wallets.PasswordFinder;
@@ -32,11 +31,6 @@ namespace WalletWasabi.Fluent.ViewModels.Login.PasswordFinder
var options = new PasswordFinderOptions(wallet, password);
Navigate().To(new SelectCharsetViewModel(options));
}
-
- if (dialogResult.Kind == DialogResultKind.Cancel)
- {
- Navigate().Clear();
- }
}
}
}

remove unnecessary `cancel` logic