瀏覽代碼

Fix macOS saving path

Ruben 5 月之前
父節點
當前提交
5555f45987
共有 1 個文件被更改,包括 9 次插入1 次删除
  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);
     }