Sfoglia il codice sorgente

Save default settings when no settings file is present #137

Ruben 6 mesi fa
parent
commit
5cf3048321
1 ha cambiato i file con 10 aggiunte e 1 eliminazioni
  1. 10 1
      src/PicView.Core/Config/SettingsManager.cs

+ 10 - 1
src/PicView.Core/Config/SettingsManager.cs

@@ -196,7 +196,16 @@ public static class SettingsManager
                 await SaveSettingsToPathAsync(GetRoamingSettingsPath()).ConfigureAwait(false);
                 return true;
             }
-            await SaveSettingsToPathAsync(CurrentSettingsPath).ConfigureAwait(false);
+
+            if (!string.IsNullOrWhiteSpace(CurrentSettingsPath))
+            {
+                await SaveSettingsToPathAsync(CurrentSettingsPath).ConfigureAwait(false);
+            }
+            else
+            {
+                await SaveSettingsToPathAsync(GetUserSettingsPath()).ConfigureAwait(false);
+            }
+
             return true;
         }
         catch (UnauthorizedAccessException)