mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
fix another hardcode issue, and the JsonSerialization problem
This commit is contained in:
parent
aa3e7decd8
commit
be8abafdda
1 changed files with 18 additions and 12 deletions
|
|
@ -46,7 +46,13 @@ namespace Flow.Launcher.Core.Plugin
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static readonly JsonSerializerOptions _options = new() {Converters = {new JsonObjectConverter()}};
|
private static readonly JsonSerializerOptions _options = new()
|
||||||
|
{
|
||||||
|
Converters =
|
||||||
|
{
|
||||||
|
new JsonObjectConverter()
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
private async Task<List<Result>> DeserializedResultAsync(Stream output)
|
private async Task<List<Result>> DeserializedResultAsync(Stream output)
|
||||||
{
|
{
|
||||||
|
|
@ -88,10 +94,10 @@ namespace Flow.Launcher.Core.Plugin
|
||||||
{
|
{
|
||||||
return !result.JsonRPCAction.DontHideAfterAction;
|
return !result.JsonRPCAction.DontHideAfterAction;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result.JsonRPCAction.Method.StartsWith("Flow.Launcher."))
|
if (result.JsonRPCAction.Method.StartsWith("Flow.Launcher."))
|
||||||
{
|
{
|
||||||
ExecuteFlowLauncherAPI(result.JsonRPCAction.Method[14..],
|
ExecuteFlowLauncherAPI(result.JsonRPCAction.Method["Flow.Launcher.".Length..],
|
||||||
result.JsonRPCAction.Parameters);
|
result.JsonRPCAction.Parameters);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -102,15 +108,12 @@ namespace Flow.Launcher.Core.Plugin
|
||||||
{
|
{
|
||||||
return !result.JsonRPCAction.DontHideAfterAction;
|
return !result.JsonRPCAction.DontHideAfterAction;
|
||||||
}
|
}
|
||||||
|
|
||||||
JsonRPCRequestModel jsonRpcRequestModel =
|
var jsonRpcRequestModel = JsonSerializer.Deserialize<JsonRPCRequestModel>(actionResponse, _options);
|
||||||
JsonSerializer.Deserialize<JsonRPCRequestModel>(actionResponse);
|
|
||||||
|
if (jsonRpcRequestModel?.Method?.StartsWith("Flow.Launcher.") ?? false)
|
||||||
if (jsonRpcRequestModel != null
|
|
||||||
&& !string.IsNullOrEmpty(jsonRpcRequestModel.Method)
|
|
||||||
&& jsonRpcRequestModel.Method.StartsWith("Flow.Launcher."))
|
|
||||||
{
|
{
|
||||||
ExecuteFlowLauncherAPI(jsonRpcRequestModel.Method.Substring(4),
|
ExecuteFlowLauncherAPI(jsonRpcRequestModel.Method["Flow.Launcher.".Length..],
|
||||||
jsonRpcRequestModel.Parameters);
|
jsonRpcRequestModel.Parameters);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -188,7 +191,10 @@ namespace Flow.Launcher.Core.Plugin
|
||||||
|
|
||||||
if (result.StartsWith("DEBUG:"))
|
if (result.StartsWith("DEBUG:"))
|
||||||
{
|
{
|
||||||
MessageBox.Show(new Form {TopMost = true}, result.Substring(6));
|
MessageBox.Show(new Form
|
||||||
|
{
|
||||||
|
TopMost = true
|
||||||
|
}, result.Substring(6));
|
||||||
return string.Empty;
|
return string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue