File tree Expand file tree Collapse file tree 1 file changed +11
-21
lines changed
Plugins/Flow.Launcher.Plugin.PluginsManager Expand file tree Collapse file tree 1 file changed +11
-21
lines changed Original file line number Diff line number Diff line change @@ -196,11 +196,7 @@ internal async Task InstallOrUpdateAsync(UserPlugin plugin)
196
196
if ( downloadCancelled )
197
197
return ;
198
198
else
199
- Application . Current . Dispatcher . Invoke ( ( ) =>
200
- {
201
- prgBox . Close ( ) ;
202
- prgBox = null ;
203
- } ) ;
199
+ CleanupProgressBoxEx ( prgBox ) ;
204
200
}
205
201
else
206
202
{
@@ -221,14 +217,7 @@ internal async Task InstallOrUpdateAsync(UserPlugin plugin)
221
217
catch ( HttpRequestException e )
222
218
{
223
219
// force close progress box
224
- Application . Current . Dispatcher . Invoke ( ( ) =>
225
- {
226
- if ( prgBox != null )
227
- {
228
- prgBox . Close ( ) ;
229
- prgBox = null ;
230
- }
231
- } ) ;
220
+ CleanupProgressBoxEx ( prgBox ) ;
232
221
233
222
// show error message
234
223
Context . API . ShowMsgError (
@@ -241,14 +230,7 @@ internal async Task InstallOrUpdateAsync(UserPlugin plugin)
241
230
catch ( Exception e )
242
231
{
243
232
// force close progress box
244
- Application . Current . Dispatcher . Invoke ( ( ) =>
245
- {
246
- if ( prgBox != null )
247
- {
248
- prgBox . Close ( ) ;
249
- prgBox = null ;
250
- }
251
- } ) ;
233
+ CleanupProgressBoxEx ( prgBox ) ;
252
234
253
235
// show error message
254
236
Context . API . ShowMsgError ( Context . API . GetTranslation ( "plugin_pluginsmanager_install_error_title" ) ,
@@ -274,6 +256,14 @@ internal async Task InstallOrUpdateAsync(UserPlugin plugin)
274
256
}
275
257
}
276
258
259
+ private static void CleanupProgressBoxEx ( IProgressBoxEx prgBox )
260
+ {
261
+ Application . Current . Dispatcher . Invoke ( ( ) =>
262
+ {
263
+ prgBox ? . Close ( ) ;
264
+ } ) ;
265
+ }
266
+
277
267
internal async ValueTask < List < Result > > RequestUpdateAsync ( string search , CancellationToken token ,
278
268
bool usePrimaryUrlOnly = false )
279
269
{
You can’t perform that action at this time.
0 commit comments