瀏覽代碼

Tell the user we're crashing at the moment

CPKreuz 2 年之前
父節點
當前提交
861330062a
共有 1 個文件被更改,包括 12 次插入1 次删除
  1. 12 1
      src/PixiEditor/Helpers/CrashHelper.cs

+ 12 - 1
src/PixiEditor/Helpers/CrashHelper.cs

@@ -3,9 +3,11 @@ using System.IO;
 using System.Net.Http;
 using System.Runtime.CompilerServices;
 using System.Text;
+using System.Windows.Input;
 using ByteSizeLib;
 using Hardware.Info;
 using PixiEditor.Models.DataHolders;
+using Mouse = System.Windows.Input.Mouse;
 
 namespace PixiEditor.Helpers;
 
@@ -15,7 +17,16 @@ internal class CrashHelper
 
     public static void SaveCrashInfo(Exception exception)
     {
-        CrashReport report = CrashReport.Generate(exception);
+        try
+        {
+            Mouse.OverrideCursor = Cursors.Wait;
+        }
+        catch (Exception e)
+        {
+            exception = new AggregateException(exception, e);
+        }
+        
+        var report = CrashReport.Generate(exception);
         report.TrySave();
         report.RestartToCrashReport();
     }