1
1
Эх сурвалжийг харах

Save default settings when no settings file is present #137

Ruben 6 сар өмнө
parent
commit
5cf3048321

+ 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)