Skip to content

Commit aa3e7de

Browse files
committed
Fix Don'tHideAfterAction logic for JsonRPCPlugin.cs
1 parent a5f5c09 commit aa3e7de

File tree

1 file changed

+24
-17
lines changed

1 file changed

+24
-17
lines changed

Flow.Launcher.Core/Plugin/JsonRPCPlugin.cs

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -84,27 +84,34 @@ private List<Result> ParseResults(JsonRPCQueryResponseModel queryResponseModel)
8484
{
8585
if (result.JsonRPCAction == null) return false;
8686

87-
if (!string.IsNullOrEmpty(result.JsonRPCAction.Method))
87+
if (string.IsNullOrEmpty(result.JsonRPCAction.Method))
8888
{
89-
if (result.JsonRPCAction.Method.StartsWith("Flow.Launcher."))
89+
return !result.JsonRPCAction.DontHideAfterAction;
90+
}
91+
92+
if (result.JsonRPCAction.Method.StartsWith("Flow.Launcher."))
93+
{
94+
ExecuteFlowLauncherAPI(result.JsonRPCAction.Method[14..],
95+
result.JsonRPCAction.Parameters);
96+
}
97+
else
98+
{
99+
var actionResponse = ExecuteCallback(result.JsonRPCAction);
100+
101+
if (string.IsNullOrEmpty(actionResponse))
90102
{
91-
ExecuteFlowLauncherAPI(result.JsonRPCAction.Method[14..],
92-
result.JsonRPCAction.Parameters);
103+
return !result.JsonRPCAction.DontHideAfterAction;
93104
}
94-
else
105+
106+
JsonRPCRequestModel jsonRpcRequestModel =
107+
JsonSerializer.Deserialize<JsonRPCRequestModel>(actionResponse);
108+
109+
if (jsonRpcRequestModel != null
110+
&& !string.IsNullOrEmpty(jsonRpcRequestModel.Method)
111+
&& jsonRpcRequestModel.Method.StartsWith("Flow.Launcher."))
95112
{
96-
string actionReponse = ExecuteCallback(result.JsonRPCAction);
97-
if (string.IsNullOrEmpty(actionReponse))
98-
return false;
99-
JsonRPCRequestModel jsonRpcRequestModel =
100-
JsonSerializer.Deserialize<JsonRPCRequestModel>(actionReponse);
101-
if (jsonRpcRequestModel != null
102-
&& !string.IsNullOrEmpty(jsonRpcRequestModel.Method)
103-
&& jsonRpcRequestModel.Method.StartsWith("Flow.Launcher."))
104-
{
105-
ExecuteFlowLauncherAPI(jsonRpcRequestModel.Method.Substring(4),
106-
jsonRpcRequestModel.Parameters);
107-
}
113+
ExecuteFlowLauncherAPI(jsonRpcRequestModel.Method.Substring(4),
114+
jsonRpcRequestModel.Parameters);
108115
}
109116
}
110117

0 commit comments

Comments
 (0)