Skip to content

Commit 3ec27ed

Browse files
committed
Use ConcurrentDictionary for JsonRPC Settings
1 parent 57541b3 commit 3ec27ed

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Flow.Launcher.Core/Plugin/JsonRPCPluginSettings.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.Collections.Generic;
1+
using System.Collections.Concurrent;
2+
using System.Collections.Generic;
23
using System.Threading.Tasks;
34
using System.Windows;
45
using System.Windows.Controls;
@@ -16,10 +17,10 @@ public class JsonRPCPluginSettings
1617
public Dictionary<string, FrameworkElement> SettingControls { get; } = new();
1718

1819
public IReadOnlyDictionary<string, object> Inner => Settings;
19-
protected Dictionary<string, object> Settings { get; set; }
20+
protected ConcurrentDictionary<string, object> Settings { get; set; }
2021
public required IPublicAPI API { get; init; }
2122

22-
private JsonStorage<Dictionary<string, object>> _storage;
23+
private JsonStorage<ConcurrentDictionary<string, object>> _storage;
2324

2425
// maybe move to resource?
2526
private static readonly Thickness settingControlMargin = new(0, 9, 18, 9);
@@ -33,7 +34,7 @@ public class JsonRPCPluginSettings
3334

3435
public async Task InitializeAsync()
3536
{
36-
_storage = new JsonStorage<Dictionary<string, object>>(SettingPath);
37+
_storage = new JsonStorage<ConcurrentDictionary<string, object>>(SettingPath);
3738
Settings = await _storage.LoadAsync();
3839

3940
foreach (var (type, attributes) in Configuration.Body)

0 commit comments

Comments
 (0)