@@ -46,7 +46,13 @@ public List<Result> LoadContextMenus(Result selectedResult)
46
46
}
47
47
}
48
48
49
- private static readonly JsonSerializerOptions _options = new ( ) { Converters = { new JsonObjectConverter ( ) } } ;
49
+ private static readonly JsonSerializerOptions _options = new ( )
50
+ {
51
+ Converters =
52
+ {
53
+ new JsonObjectConverter ( )
54
+ }
55
+ } ;
50
56
51
57
private async Task < List < Result > > DeserializedResultAsync ( Stream output )
52
58
{
@@ -84,27 +90,31 @@ private List<Result> ParseResults(JsonRPCQueryResponseModel queryResponseModel)
84
90
{
85
91
if ( result . JsonRPCAction == null ) return false ;
86
92
87
- if ( ! string . IsNullOrEmpty ( result . JsonRPCAction . Method ) )
93
+ if ( string . IsNullOrEmpty ( result . JsonRPCAction . Method ) )
94
+ {
95
+ return ! result . JsonRPCAction . DontHideAfterAction ;
96
+ }
97
+
98
+ if ( result . JsonRPCAction . Method . StartsWith ( "Flow.Launcher." ) )
88
99
{
89
- if ( result . JsonRPCAction . Method . StartsWith ( "Flow.Launcher." ) )
100
+ ExecuteFlowLauncherAPI ( result . JsonRPCAction . Method [ "Flow.Launcher." . Length ..] ,
101
+ result . JsonRPCAction . Parameters ) ;
102
+ }
103
+ else
104
+ {
105
+ var actionResponse = ExecuteCallback ( result . JsonRPCAction ) ;
106
+
107
+ if ( string . IsNullOrEmpty ( actionResponse ) )
90
108
{
91
- ExecuteFlowLauncherAPI ( result . JsonRPCAction . Method [ 14 ..] ,
92
- result . JsonRPCAction . Parameters ) ;
109
+ return ! result . JsonRPCAction . DontHideAfterAction ;
93
110
}
94
- else
111
+
112
+ var jsonRpcRequestModel = JsonSerializer . Deserialize < JsonRPCRequestModel > ( actionResponse , _options ) ;
113
+
114
+ if ( jsonRpcRequestModel ? . Method ? . StartsWith ( "Flow.Launcher." ) ?? false )
95
115
{
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
- }
116
+ ExecuteFlowLauncherAPI ( jsonRpcRequestModel . Method [ "Flow.Launcher." . Length ..] ,
117
+ jsonRpcRequestModel . Parameters ) ;
108
118
}
109
119
}
110
120
@@ -181,7 +191,10 @@ protected string Execute(ProcessStartInfo startInfo)
181
191
182
192
if ( result . StartsWith ( "DEBUG:" ) )
183
193
{
184
- MessageBox . Show ( new Form { TopMost = true } , result . Substring ( 6 ) ) ;
194
+ MessageBox . Show ( new Form
195
+ {
196
+ TopMost = true
197
+ } , result . Substring ( 6 ) ) ;
185
198
return string . Empty ;
186
199
}
187
200
0 commit comments