filter sync can be skipped too
MODIFY
WalletWasabi.Fluent/ViewModels/WalletManagerViewModel.cs
WalletWasabi.Fluent/ViewModels/WalletManagerViewModel.cs
@@ -53,22 +53,25 @@ public partial class WalletManagerViewModel : ViewModelBase
Observable
.FromEventPattern<WalletState>(Services.WalletManager, nameof(WalletManager.WalletStateChanged))
.ObserveOn(RxApp.MainThreadScheduler)
- .Subscribe(
- x =>
+ .Select(x => x.Sender as Wallet)
+ .WhereNotNull()
+ .Subscribe(wallet =>
{
- var wallet = x.Sender as Wallet;
-
- if (wallet is { } && _walletDictionary.ContainsKey(wallet))
+ if (!_walletDictionary.TryGetValue(wallet, out var walletViewModel))
{
+ return;
+ }
+
if (wallet.State == WalletState.Stopping)
{
- RemoveWallet(_walletDictionary[wallet]);
+ RemoveWallet(walletViewModel);
}
- else if (_walletDictionary[wallet] is ClosedWalletViewModel { IsLoggedIn: true } cwvm && wallet.State == WalletState.Started)
+ else if (walletViewModel is ClosedWalletViewModel { IsLoggedIn: true } cwvm &&
+ ((cwvm.Wallet.KeyManager.SkipSynchronization && cwvm.Wallet.State == WalletState.Starting) ||
+ cwvm.Wallet.State == WalletState.Started))
{
OpenClosedWallet(cwvm);
}
- }
AnyWalletStarted = Items.OfType<WalletViewModelBase>().Any(y => y.WalletState == WalletState.Started);
});
@@ -139,8 +142,6 @@ public partial class WalletManagerViewModel : ViewModelBase
public async Task LoadWalletAsync(Wallet wallet)
{
- wallet.KeyManager.SetNonNewlyCreated();
-
if (wallet.State != WalletState.Uninitialized)
{
throw new Exception("Wallet is already being logged in.");

filter sync can be skipped too