safely add wallets, in future we may be passed a wallet already initialised.
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/WalletExplorerViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/WalletExplorerViewModel.cs
@@ -57,9 +57,18 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
Observable.FromEventPattern<Wallet>(WalletManager, nameof(WalletManager.WalletAdded))
.ObserveOn(RxApp.MainThreadScheduler)
- .Subscribe(x =>
+ .Select(x => x.EventArgs)
+ .OfType<Wallet>()
+ .Subscribe(wallet =>
+ {
+ if (wallet.State <= WalletState.Starting)
{
- Wallets.InsertSorted(new ClosedWalletViewModel(x.EventArgs));
+ Wallets.InsertSorted(new ClosedWalletViewModel(wallet));
+ }
+ else
+ {
+ Wallets.InsertSorted(new WalletViewModel(wallet));
+ }
});
var shell = IoC.Get<IShell>();

safely add wallets, in future we may be passed a wallet already initialised.