From 7b2da25c0bf8853eec1ba2fd4ad9b36fbf2d345d Mon Sep 17 00:00:00 2001 From: leo Date: Tue, 10 Sep 2024 16:37:39 +0800 Subject: [PATCH] enhance: do NOT save preference.json while loading --- src/ViewModels/Preference.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ViewModels/Preference.cs b/src/ViewModels/Preference.cs index a157a033..1611fe3e 100644 --- a/src/ViewModels/Preference.cs +++ b/src/ViewModels/Preference.cs @@ -431,6 +431,9 @@ namespace SourceGit.ViewModels public void Save() { + if (_isLoading) + return; + var file = Path.Combine(Native.OS.DataDir, "preference.json"); var data = JsonSerializer.Serialize(this, JsonCodeGen.Default.Preference); File.WriteAllText(file, data);