From c70a090983fad3f75d67ed6cacfec5076a9c07e1 Mon Sep 17 00:00:00 2001 From: SuperDooper <37051355+superdooper86@users.noreply.github.com> Date: Fri, 8 May 2026 16:00:01 +0200 Subject: [PATCH] fix: load from cache immediately after login, background refresh after 3s --- windows/PopupWindow.xaml.cs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/windows/PopupWindow.xaml.cs b/windows/PopupWindow.xaml.cs index 7f0acd9..cb2483a 100644 --- a/windows/PopupWindow.xaml.cs +++ b/windows/PopupWindow.xaml.cs @@ -333,11 +333,18 @@ public partial class PopupWindow : Window var login = new LoginWindow { Owner = this }; if (login.ShowDialog() == true) { - // Brief pause so the LoginWindow WebView2 fully releases its user data folder lock - // before RefreshAsync may create another WebView2 on the same folder. - await Task.Delay(1500); - await VM.RefreshAsync(); + // Show cached data from SaveAndClose immediately (no WebView2 needed) + await VM.LoadFromCacheAsync(); InitSettings(); + ShowMain(); + + // Full refresh in background after WebView2 folder is definitely released + _ = Task.Run(async () => + { + await Task.Delay(3000); + await VM.RefreshAsync(); + await Application.Current.Dispatcher.InvokeAsync(InitSettings); + }); } Show(); Activate();