@@ -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
{
@@ -88,10 +94,10 @@ private List<Result> ParseResults(JsonRPCQueryResponseModel queryResponseModel)
88
94
{
89
95
return ! result . JsonRPCAction . DontHideAfterAction ;
90
96
}
91
-
97
+
92
98
if ( result . JsonRPCAction . Method . StartsWith ( "Flow.Launcher." ) )
93
99
{
94
- ExecuteFlowLauncherAPI ( result . JsonRPCAction . Method [ 14 ..] ,
100
+ ExecuteFlowLauncherAPI ( result . JsonRPCAction . Method [ "Flow.Launcher." . Length ..] ,
95
101
result . JsonRPCAction . Parameters ) ;
96
102
}
97
103
else
@@ -102,15 +108,12 @@ private List<Result> ParseResults(JsonRPCQueryResponseModel queryResponseModel)
102
108
{
103
109
return ! result . JsonRPCAction . DontHideAfterAction ;
104
110
}
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." ) )
111
+
112
+ var jsonRpcRequestModel = JsonSerializer . Deserialize < JsonRPCRequestModel > ( actionResponse , _options ) ;
113
+
114
+ if ( jsonRpcRequestModel ? . Method ? . StartsWith ( "Flow.Launcher." ) ?? false )
112
115
{
113
- ExecuteFlowLauncherAPI ( jsonRpcRequestModel . Method . Substring ( 4 ) ,
116
+ ExecuteFlowLauncherAPI ( jsonRpcRequestModel . Method [ "Flow.Launcher." . Length .. ] ,
114
117
jsonRpcRequestModel . Parameters ) ;
115
118
}
116
119
}
@@ -188,7 +191,10 @@ protected string Execute(ProcessStartInfo startInfo)
188
191
189
192
if ( result . StartsWith ( "DEBUG:" ) )
190
193
{
191
- MessageBox . Show ( new Form { TopMost = true } , result . Substring ( 6 ) ) ;
194
+ MessageBox . Show ( new Form
195
+ {
196
+ TopMost = true
197
+ } , result . Substring ( 6 ) ) ;
192
198
return string . Empty ;
193
199
}
194
200
0 commit comments