AdvancedOptionsInteraction null warning fix
MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/RecoverWalletViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWallet/RecoverWalletViewModel.cs
@@ -45,19 +45,6 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet
this.ValidateProperty(x => x.Mnemonics, ValidateMnemonics);
- AdvancedRecoveryOptionsDialogCommand = ReactiveCommand.CreateFromTask(
- async () =>
- {
- var (accountKeyPathIn, minGapLimitIn) = await AdvancedOptionsInteraction
- .Handle((AccountKeyPath, MinGapLimit)).ToTask();
-
- if (accountKeyPathIn is { } && minGapLimitIn is { })
- {
- AccountKeyPath = accountKeyPathIn;
- MinGapLimit = (int)minGapLimitIn;
- }
- });
-
FinishCommandCanExecute =
this.WhenAnyValue(x => x.CurrentMnemonics)
.Select(currentMnemonics => currentMnemonics is { } && !Validations.Any);
@@ -67,11 +54,23 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet
FinishCommandCanExecute);
AdvancedOptionsInteraction = new Interaction<(KeyPath, int), (KeyPath?, int?)>();
-
AdvancedOptionsInteraction.RegisterHandler(
async interaction =>
interaction.SetOutput(
await new AdvancedRecoveryOptionsViewModel(navigationState, NavigationTarget.DialogHost, interaction.Input).ShowDialogAsync()));
+
+ AdvancedRecoveryOptionsDialogCommand = ReactiveCommand.CreateFromTask(
+ async () =>
+ {
+ var (accountKeyPathIn, minGapLimitIn) = await AdvancedOptionsInteraction
+ .Handle((AccountKeyPath, MinGapLimit)).ToTask();
+
+ if (accountKeyPathIn is { } && minGapLimitIn is { })
+ {
+ AccountKeyPath = accountKeyPathIn;
+ MinGapLimit = (int)minGapLimitIn;
+ }
+ });
}
private async Task OnNext(NavigationStateViewModel navigationState, WalletManager walletManager, Network network, string? walletName)

AdvancedOptionsInteraction null warning fix