add wallet to wallet manager only on success dialog.
MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/Create/ConfirmRecoveryWordsViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWallet/Create/ConfirmRecoveryWordsViewModel.cs
@@ -32,9 +32,7 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet.Create
NextCommand = ReactiveCommand.Create(
() =>
{
- walletManager.AddWallet(keyManager);
-
- Navigate().To(new AddedWalletPageViewModel(keyManager.WalletName, WalletType.Normal));
+ Navigate().To(new AddedWalletPageViewModel(walletManager, keyManager, WalletType.Normal));
},
finishCommandCanExecute);

MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/HardwareWallet/DetectedHardwareWalletViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWallet/HardwareWallet/DetectedHardwareWalletViewModel.cs
@@ -45,9 +45,11 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet.HardwareWallet
try
{
- await hardwareWalletOperations.GenerateWalletAsync(WalletName);
+ var km = await hardwareWalletOperations.GenerateWalletAsync(WalletName);
+ var walletManager = hardwareWalletOperations.WalletManager;
hardwareWalletOperations.Dispose();
- Navigate().To(new AddedWalletPageViewModel(WalletName, Type));
+
+ Navigate().To(new AddedWalletPageViewModel(walletManager, km, Type));
}
catch(Exception ex)
{

MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/HardwareWallet/HardwareWalletOperations.cs
WalletWasabi.Fluent/ViewModels/AddWallet/HardwareWallet/HardwareWalletOperations.cs
@@ -61,7 +61,7 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet.HardwareWallet
}
}
- public async Task GenerateWalletAsync(string walletName)
+ public async Task<KeyManager> GenerateWalletAsync(string walletName)
{
var selectedDevice = SelectedDevice;
@@ -83,14 +83,16 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet.HardwareWallet
cts.Token).ConfigureAwait(false);
var path = WalletManager.WalletDirectories.GetWalletFilePaths(walletName).walletFilePath;
- var km = KeyManager.CreateNewHardwareWalletWatchOnly(fingerPrint, extPubKey, path);
- WalletManager.AddWallet(km);
+ return KeyManager.CreateNewHardwareWalletWatchOnly(fingerPrint, extPubKey, path);
+
}
catch (Exception)
{
StartDetection();
throw;
}
+
+ return null;
}
public async Task InitHardwareWalletAsync(HwiEnumerateEntry device)

MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/RecoverWalletViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWallet/RecoverWalletViewModel.cs
@@ -89,25 +89,25 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet
{
try
{
- await Task.Run(
+ var keyManager = await Task.Run(
() =>
{
var walletFilePath = walletManager.WalletDirectories.GetWalletFilePaths(walletName!)
.walletFilePath;
- var keyManager = KeyManager.Recover(
+ var result = KeyManager.Recover(
CurrentMnemonics!,
password!,
walletFilePath,
AccountKeyPath,
MinGapLimit);
- keyManager.SetNetwork(network);
+ result.SetNetwork(network);
- walletManager.AddWallet(keyManager);
+ return result;
});
- Navigate().To(new AddedWalletPageViewModel(walletName!, WalletType.Normal));
+ Navigate().To(new AddedWalletPageViewModel(walletManager, keyManager, WalletType.Normal));
return;
}

add wallet to wallet manager only on success dialog.