Skip to content

Commit 87f35d4

Browse files
authored
Merge branch 'dev' into update_all
2 parents 4ed1c3c + f7f0d40 commit 87f35d4

File tree

5 files changed

+19
-15
lines changed

5 files changed

+19
-15
lines changed

Flow.Launcher.Core/Plugin/JsonRPCPluginBase.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,15 @@ protected void ExecuteFlowLauncherAPI(string method, object[] parameters)
126126

127127
private async Task InitSettingAsync()
128128
{
129-
if (!File.Exists(SettingConfigurationPath))
130-
return;
129+
JsonRpcConfigurationModel configuration = null;
130+
if (File.Exists(SettingConfigurationPath))
131+
{
132+
var deserializer = new DeserializerBuilder().WithNamingConvention(CamelCaseNamingConvention.Instance).Build();
133+
configuration =
134+
deserializer.Deserialize<JsonRpcConfigurationModel>(
135+
await File.ReadAllTextAsync(SettingConfigurationPath));
136+
}
131137

132-
var deserializer = new DeserializerBuilder().WithNamingConvention(CamelCaseNamingConvention.Instance)
133-
.Build();
134-
var configuration =
135-
deserializer.Deserialize<JsonRpcConfigurationModel>(
136-
await File.ReadAllTextAsync(SettingConfigurationPath));
137138

138139
Settings ??= new JsonRPCPluginSettings
139140
{

Flow.Launcher.Core/Plugin/JsonRPCPluginSettings.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace Flow.Launcher.Core.Plugin
1111
{
1212
public class JsonRPCPluginSettings
1313
{
14-
public required JsonRpcConfigurationModel Configuration { get; init; }
14+
public required JsonRpcConfigurationModel? Configuration { get; init; }
1515

1616
public required string SettingPath { get; init; }
1717
public Dictionary<string, FrameworkElement> SettingControls { get; } = new();
@@ -37,6 +37,11 @@ public async Task InitializeAsync()
3737
_storage = new JsonStorage<ConcurrentDictionary<string, object>>(SettingPath);
3838
Settings = await _storage.LoadAsync();
3939

40+
if (Settings != null)
41+
{
42+
return;
43+
}
44+
4045
foreach (var (type, attributes) in Configuration.Body)
4146
{
4247
if (attributes.Name == null)
@@ -59,10 +64,7 @@ public void UpdateSettings(IReadOnlyDictionary<string, object> settings)
5964

6065
foreach (var (key, value) in settings)
6166
{
62-
if (Settings.ContainsKey(key))
63-
{
64-
Settings[key] = value;
65-
}
67+
Settings[key] = value;
6668

6769
if (SettingControls.TryGetValue(key, out var control))
6870
{
@@ -83,6 +85,7 @@ public void UpdateSettings(IReadOnlyDictionary<string, object> settings)
8385
}
8486
}
8587
}
88+
Save();
8689
}
8790

8891
public async Task SaveAsync()

Flow.Launcher.Infrastructure/Flow.Launcher.Infrastructure.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
<PackageReference Include="NLog.Schema" Version="4.7.10" />
5959
<PackageReference Include="NLog.Web.AspNetCore" Version="4.13.0" />
6060
<PackageReference Include="PropertyChanged.Fody" Version="3.4.0" />
61-
<PackageReference Include="System.Drawing.Common" Version="7.0.0" />
61+
<PackageReference Include="System.Drawing.Common" Version="8.0.0" />
6262
<!--ToolGood.Words.Pinyin v3.0.2.6 results in high memory usage when search with pinyin is enabled-->
6363
<!--Bumping to it or higher needs to test and ensure this is no longer a problem-->
6464
<PackageReference Include="ToolGood.Words.Pinyin" Version="3.0.1.4" />

Flow.Launcher.Test/Flow.Launcher.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
<PrivateAssets>all</PrivateAssets>
5555
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
5656
</PackageReference>
57-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
57+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
5858
</ItemGroup>
5959

6060
</Project>

Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
</ItemGroup>
5757

5858
<ItemGroup>
59-
<PackageReference Include="Microsoft.Data.Sqlite" Version="7.0.13" />
59+
<PackageReference Include="Microsoft.Data.Sqlite" Version="8.0.0" />
6060
</ItemGroup>
6161

6262
</Project>

0 commit comments

Comments
 (0)