added wallet page adds to wallet manager when user clicks done.
MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/AddWalletPageViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWallet/AddWalletPageViewModel.cs
@@ -80,10 +80,10 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet
return;
}
- var isColdcardJson = await ImportWalletHelper.ImportWalletAsync(walletManager, WalletName, filePath);
+ var (isColdCardJson, keyManager) = await ImportWalletHelper.ImportWalletAsync(walletManager, WalletName, filePath);
// TODO: get the type from the wallet file
- Navigate().To(new AddedWalletPageViewModel(WalletName, isColdcardJson ? WalletType.Coldcard : WalletType.Normal));
+ Navigate().To(new AddedWalletPageViewModel(walletManager, keyManager, isColdCardJson ? WalletType.Coldcard : WalletType.Normal));
}
catch (Exception ex)
{

MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/AddedWalletPageViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWallet/AddedWalletPageViewModel.cs
using System.Linq;
using ReactiveUI;
+using WalletWasabi.Blockchain.Keys;
using WalletWasabi.Fluent.ViewModels.NavBar;
using WalletWasabi.Fluent.ViewModels.Navigation;
+using WalletWasabi.Wallets;
namespace WalletWasabi.Fluent.ViewModels.AddWallet
{
- public enum WalletType
- {
- Normal,
- Hardware,
- Coldcard,
- Trezor,
- Ledger
- }
-
public class AddedWalletPageViewModel : RoutableViewModel
{
- public AddedWalletPageViewModel(string walletName, WalletType type)
+ public AddedWalletPageViewModel(WalletManager walletManager, KeyManager keyManager, WalletType type)
{
Title = "Success";
- WalletName = walletName;
+ WalletName = keyManager.WalletName;
Type = type;
NextCommand = ReactiveCommand.Create(
() =>
{
+ walletManager.AddWallet(keyManager);
+
Navigate().Clear();
var navBar = NavigationManager.Get<NavBarViewModel>();
- var wallet = navBar?.Items.FirstOrDefault(x => x.WalletName == walletName);
+ var wallet = navBar?.Items.FirstOrDefault(x => x.WalletName == WalletName);
if (wallet is { } && navBar is { })
{

added wallet page adds to wallet manager when user clicks done.