Kenric Nugteren 1 рік тому
батько
коміт
d20b527e77
1 змінених файлів з 13 додано та 6 видалено
  1. 13 6
      prs.desktop/MainWindow.xaml.cs

+ 13 - 6
prs.desktop/MainWindow.xaml.cs

@@ -339,13 +339,20 @@ public partial class MainWindow : IPanelHostControl
 
             if (startupException is null && App.DatabaseSettings.Autologin)
             {
-                Logger.Send(LogType.Information, "", "Logging in");
-                progress.Report("Logging in");
-                loginStatus = TryAutoLogin();
-                if(loginStatus == ValidationStatus.VALID)
+                try
+                {
+                    Logger.Send(LogType.Information, "", "Logging in");
+                    progress.Report("Logging in");
+                    loginStatus = TryAutoLogin();
+                    if(loginStatus == ValidationStatus.VALID)
+                    {
+                        // Do the AfterLogin() here so that we aren't opening and closing progress windows again and again.
+                        AfterLogin(progress);
+                    }
+                }
+                catch(Exception e)
                 {
-                    // Do the AfterLogin() here so that we aren't opening and closing progress windows again and again.
-                    AfterLogin(progress);
+                    startupException = e;
                 }
             }
         });