mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
fix v1
This commit is contained in:
parent
b425aac159
commit
1551567269
2 changed files with 5 additions and 7 deletions
|
|
@ -47,7 +47,7 @@ namespace Flow.Launcher.Core.Plugin
|
|||
|
||||
public abstract List<Result> LoadContextMenus(Result selectedResult);
|
||||
|
||||
protected static readonly JsonSerializerOptions options = new()
|
||||
protected static readonly JsonSerializerOptions DeserializeOption = new()
|
||||
{
|
||||
PropertyNameCaseInsensitive = true,
|
||||
#pragma warning disable SYSLIB0020
|
||||
|
|
@ -63,13 +63,11 @@ namespace Flow.Launcher.Core.Plugin
|
|||
}
|
||||
};
|
||||
|
||||
private static readonly JsonSerializerOptions settingSerializeOption = new()
|
||||
protected static readonly JsonSerializerOptions RequestSerializeOption = new()
|
||||
{
|
||||
WriteIndented = true
|
||||
PropertyNameCaseInsensitive = true, PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
|
||||
};
|
||||
|
||||
private readonly Dictionary<string, FrameworkElement> _settingControls = new();
|
||||
|
||||
protected abstract Task<bool> ExecuteResultAsync(JsonRPCResult result);
|
||||
protected abstract Task<List<Result>> QueryRequestAsync(JsonRPCRequestModel request, CancellationToken token);
|
||||
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ namespace Flow.Launcher.Core.Plugin
|
|||
|
||||
protected override Task<Stream> RequestAsync(JsonRPCRequestModel request, CancellationToken token = default)
|
||||
{
|
||||
_startInfo.ArgumentList[2] = JsonSerializer.Serialize(request);
|
||||
_startInfo.ArgumentList[2] = JsonSerializer.Serialize(request, RequestSerializeOption);
|
||||
|
||||
return ExecuteAsync(_startInfo, token);
|
||||
}
|
||||
|
|
@ -47,7 +47,7 @@ namespace Flow.Launcher.Core.Plugin
|
|||
protected override string Request(JsonRPCRequestModel rpcRequest, CancellationToken token = default)
|
||||
{
|
||||
// since this is not static, request strings will build up in ArgumentList if index is not specified
|
||||
_startInfo.ArgumentList[2] = JsonSerializer.Serialize(rpcRequest);
|
||||
_startInfo.ArgumentList[2] = JsonSerializer.Serialize(rpcRequest, RequestSerializeOption);
|
||||
_startInfo.WorkingDirectory = Context.CurrentPluginMetadata.PluginDirectory;
|
||||
// TODO: Async Action
|
||||
return Execute(_startInfo);
|
||||
|
|
|
|||
Loading…
Reference in a new issue