mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Update Flow.Launcher.Core/Plugin/JsonRPCPluginSettings.cs
Co-authored-by: Yan Li <Yusyuriv@users.noreply.github.com>
This commit is contained in:
parent
afb38db572
commit
444d29506d
1 changed files with 9 additions and 10 deletions
|
|
@ -44,17 +44,16 @@ namespace Flow.Launcher.Core.Plugin
|
|||
// we need to convert it to the correct type
|
||||
foreach (var (key, value) in Settings)
|
||||
{
|
||||
if (value is JsonElement jsonElement)
|
||||
if (value is not JsonElement jsonElement) continue;
|
||||
|
||||
Settings[key] = jsonElement.ValueKind switch
|
||||
{
|
||||
Settings[key] = jsonElement.ValueKind switch
|
||||
{
|
||||
JsonValueKind.String => jsonElement.GetString() ?? value,
|
||||
JsonValueKind.True => jsonElement.GetBoolean(),
|
||||
JsonValueKind.False => jsonElement.GetBoolean(),
|
||||
JsonValueKind.Null => null,
|
||||
_ => value
|
||||
};
|
||||
}
|
||||
JsonValueKind.String => jsonElement.GetString() ?? value,
|
||||
JsonValueKind.True => jsonElement.GetBoolean(),
|
||||
JsonValueKind.False => jsonElement.GetBoolean(),
|
||||
JsonValueKind.Null => null,
|
||||
_ => value
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue