do not wait for the loading in LoginViewModel
MODIFY
WalletWasabi.Fluent/ViewModels/Login/LoginViewModel.cs
WalletWasabi.Fluent/ViewModels/Login/LoginViewModel.cs
+using System.Reactive.Concurrency;
using System.Threading.Tasks;
using System.Windows.Input;
using ReactiveUI;
@@ -48,8 +49,7 @@ namespace WalletWasabi.Fluent.ViewModels.Login
if (legalResult)
{
- Navigate().To(closedWalletViewModel);
- await LoginWalletAsync(walletManagerViewModel, closedWalletViewModel);
+ LoginWallet(walletManagerViewModel, closedWalletViewModel);
}
else
{
@@ -80,20 +80,11 @@ namespace WalletWasabi.Fluent.ViewModels.Login
public ICommand ForgotPasswordCommand { get; }
- private async Task LoginWalletAsync(WalletManagerViewModel walletManagerViewModel, ClosedWalletViewModel closedWalletViewModel)
+ private void LoginWallet(WalletManagerViewModel walletManagerViewModel, ClosedWalletViewModel closedWalletViewModel)
{
closedWalletViewModel.RaisePropertyChanged(nameof(WalletViewModelBase.IsLoggedIn));
-
- var destination = await walletManagerViewModel.LoadWalletAsync(closedWalletViewModel);
-
- if (destination is { })
- {
- Navigate().To(destination, NavigationMode.Clear);
- }
- else
- {
- await ShowErrorAsync(Title, "Error", "Wasabi was unable to login and load your wallet.");
- }
+ RxApp.MainThreadScheduler.Schedule(async () => await walletManagerViewModel.LoadWalletAsync(closedWalletViewModel));
+ Navigate().To(closedWalletViewModel, NavigationMode.Clear);
}
private async Task<bool> ShowLegalAsync(LegalChecker legalChecker)

MODIFY
WalletWasabi.Fluent/ViewModels/WalletManagerViewModel.cs
WalletWasabi.Fluent/ViewModels/WalletManagerViewModel.cs
@@ -5,7 +5,6 @@ using System.Linq;
using System.Reactive.Concurrency;
using System.Reactive.Linq;
using System.Threading.Tasks;
-using Avalonia.Threading;
using DynamicData;
using DynamicData.Binding;
using ReactiveUI;
@@ -114,7 +113,7 @@ namespace WalletWasabi.Fluent.ViewModels
public LegalChecker LegalChecker { get; }
- public async Task<WalletViewModelBase?> LoadWalletAsync(ClosedWalletViewModel closedWalletViewModel)
+ public async Task LoadWalletAsync(ClosedWalletViewModel closedWalletViewModel)
{
var wallet = closedWalletViewModel.Wallet;
@@ -135,13 +134,6 @@ namespace WalletWasabi.Fluent.ViewModels
{
Logger.LogError(ex);
}
-
- if (_walletDictionary.ContainsKey(wallet))
- {
- return _walletDictionary[wallet];
- }
-
- return null;
}
private void OpenClosedWallet(WalletManager walletManager, UiConfig uiConfig, ClosedWalletViewModel closedWalletViewModel)

do not wait for the loading in LoginViewModel