瀏覽代碼

show hello there and fix crash

Krzysztof Krysiński 5 月之前
父節點
當前提交
07e2eac350
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      src/PixiEditor/ViewModels/SubViewModels/FileViewModel.cs

+ 3 - 3
src/PixiEditor/ViewModels/SubViewModels/FileViewModel.cs

@@ -148,8 +148,7 @@ internal class FileViewModel : SubViewModel<ViewModelMain>
         {
             OpenFromPath(file);
         }
-        else if ((Owner.DocumentManagerSubViewModel.Documents.Count == 0 && !args.Contains("--crash")) &&
-                 !args.Contains("--openedInExisting"))
+        else if (!args.Contains("--crash") && !args.Contains("--openedInExisting"))
         {
             if (preferences!.GetPreference("ShowStartupWindow", true))
             {
@@ -817,7 +816,8 @@ internal class FileViewModel : SubViewModel<ViewModelMain>
         if (originalPath != null && File.Exists(originalPath))
         {
             DateTime saveFileWriteTime = File.GetLastWriteTime(originalPath);
-            DateTime autosaveWriteTime = File.GetLastWriteTime(autosavePath);
+            bool autosaveExists = autosavePath != null && File.Exists(autosavePath);
+            DateTime autosaveWriteTime = autosaveExists ? File.GetLastWriteTime(autosavePath) : DateTime.MinValue;
 
             loadFromUserFile = saveFileWriteTime > autosaveWriteTime;
         }