Browse Source

Fix macOS saving path

Ruben 4 months ago
parent
commit
5555f45987
1 changed files with 9 additions and 1 deletions
  1. 9 1
      src/PicView.Core/Config/SettingsManager.cs

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

@@ -176,7 +176,15 @@ public static class SettingsManager
             throw new JsonException("Failed to deserialize settings");
         }
 
-        CurrentSettingsPath = path.Replace("/", "\\");
+        if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
+        {
+            CurrentSettingsPath = path.Replace("/", "\\");
+        }
+        else
+        {
+            CurrentSettingsPath = path;
+        }
+        
         Settings = await UpgradeSettingsIfNeededAsync(settings).ConfigureAwait(false);
     }