Quellcode durchsuchen

Don't reopen if autosave is disabled

Krzysztof Krysiński vor 3 Monaten
Ursprung
Commit
92f1b5b63c
1 geänderte Dateien mit 9 neuen und 0 gelöschten Zeilen
  1. 9 0
      src/PixiEditor/ViewModels/SubViewModels/FileViewModel.cs

+ 9 - 0
src/PixiEditor/ViewModels/SubViewModels/FileViewModel.cs

@@ -685,6 +685,15 @@ internal class FileViewModel : SubViewModel<ViewModelMain>
         var history =
             preferences.GetLocalPreference<List<AutosaveHistorySession>>(PreferencesConstants.AutosaveHistory);
 
+        bool autosaveEnabled = preferences.GetPreference<bool>(
+            PreferencesConstants.AutosaveEnabled,
+            PreferencesConstants.AutosaveEnabledDefault);
+
+        if(!autosaveEnabled)
+        {
+            return;
+        }
+
         // There are no autosave attempts .. but what if the user has just launched pixieditor for the first time,
         // and it unexpectedly closed before auto saving anything. They could've still had some files open, and they won't be reopened in this session
         // I'll say this is by design