fix disconnect during connection issue
MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/HardwareWallet/ConnectHardwareWalletViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWallet/HardwareWallet/ConnectHardwareWalletViewModel.cs
@@ -115,6 +115,8 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet.HardwareWallet
{
base.OnNavigatedTo(inStack, disposable);
+ Message = "";
+
HardwareWalletOperations.HardwareWalletsFound += OnHardwareWalletsFound;
HardwareWalletOperations.SearchingHasNoResult += OnSearchingHasNoResult;
HardwareWalletOperations.PassphraseTimer.Elapsed += OnPassphraseNeeded;

MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/HardwareWallet/DetectedHardwareWalletViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWallet/HardwareWallet/DetectedHardwareWalletViewModel.cs
-using System.Threading.Tasks;
+using System;
using System.Windows.Input;
using ReactiveUI;
using WalletWasabi.Extensions;
using WalletWasabi.Fluent.ViewModels.Navigation;
using WalletWasabi.Hwi.Models;
+using WalletWasabi.Logging;
namespace WalletWasabi.Fluent.ViewModels.AddWallet.HardwareWallet
{
@@ -41,9 +42,18 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet.HardwareWallet
{
IsBusy = true;
- await Task.Run(async () => await hardwareWalletOperations.GenerateWalletAsync(WalletName));
+ try
+ {
+ await hardwareWalletOperations.GenerateWalletAsync(WalletName);
Navigate().To(new AddedWalletPageViewModel(WalletName, Type));
+ }
+ catch(Exception ex)
+ {
+ // TODO: Notify the user
+ Logger.LogError(ex);
+ Navigate().Back();
+ }
IsBusy = false;
});

MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/HardwareWallet/HardwareWalletOperations.cs
WalletWasabi.Fluent/ViewModels/AddWallet/HardwareWallet/HardwareWalletOperations.cs
@@ -84,10 +84,10 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet.HardwareWallet
var km = KeyManager.CreateNewHardwareWalletWatchOnly(fingerPrint, extPubKey, path);
WalletManager.AddWallet(km);
}
- catch (Exception ex)
+ catch (Exception)
{
- Logger.LogError(ex);
StartDetection();
+ throw;
}
}

fix disconnect during connection issue