Skip to content

Commit 85d6edb

Browse files
Update PluginConfig
1 parent 3529ede commit 85d6edb

1 file changed

Lines changed: 2 additions & 9 deletions

File tree

MogMogCheck/Config/PluginConfig.cs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public partial class PluginConfig : IPluginConfiguration
2020
public int LastSavedConfigHash { get; set; }
2121

2222
[JsonIgnore]
23-
public static JsonSerializerOptions? SerializerOptions { get; private set; } = new()
23+
public static JsonSerializerOptions? SerializerOptions { get; } = new()
2424
{
2525
IncludeFields = true,
2626
WriteIndented = true,
@@ -46,13 +46,6 @@ public static PluginConfig Load(IDalamudPluginInterface pluginInterface, IPlugin
4646
if (node == null)
4747
return new();
4848

49-
if (node is not JsonObject config)
50-
return new();
51-
52-
var version = config[nameof(Version)]?.GetValue<int>();
53-
if (version == null)
54-
return new();
55-
5649
return JsonSerializer.Deserialize<PluginConfig>(node, SerializerOptions) ?? new();
5750
}
5851

@@ -61,7 +54,7 @@ public void Save()
6154
try
6255
{
6356
var serialized = JsonSerializer.Serialize(this, SerializerOptions);
64-
var hash = serialized.GetHashCode();
57+
var hash = StringComparer.Ordinal.GetHashCode(serialized);
6558

6659
if (LastSavedConfigHash != hash)
6760
{

0 commit comments

Comments
 (0)