File tree Expand file tree Collapse file tree 3 files changed +11
-14
lines changed
Plugins/Flow.Launcher.Plugin.PluginsManager Expand file tree Collapse file tree 3 files changed +11
-14
lines changed Original file line number Diff line number Diff line change @@ -66,11 +66,16 @@ public void ReportProgress(double progress)
66
66
67
67
private new void Close ( )
68
68
{
69
+ if ( ! Application . Current . Dispatcher . CheckAccess ( ) )
70
+ {
71
+ Application . Current . Dispatcher . Invoke ( Close ) ;
72
+ }
73
+
69
74
if ( _isClosed )
70
75
{
71
76
return ;
72
77
}
73
-
78
+
74
79
base . Close ( ) ;
75
80
_isClosed = true ;
76
81
}
Original file line number Diff line number Diff line change 6
6
public interface IProgressBoxEx
7
7
{
8
8
/// <summary>
9
- /// Show progress box. It should be called from the main ui thread.
9
+ /// Show progress box.
10
10
/// </summary>
11
11
/// <param name="progress">
12
12
/// Progress value. Should be between 0 and 100. When progress is 100, the progress box will be closed.
13
13
/// </param>
14
14
public void ReportProgress ( double progress ) ;
15
15
16
16
/// <summary>
17
- /// Close progress box. It should be called from the main ui thread.
17
+ /// Close progress box.
18
18
/// </summary>
19
19
public void Close ( ) ;
20
20
}
Original file line number Diff line number Diff line change @@ -196,7 +196,7 @@ internal async Task InstallOrUpdateAsync(UserPlugin plugin)
196
196
if ( downloadCancelled )
197
197
return ;
198
198
else
199
- CleanupProgressBoxEx ( prgBox ) ;
199
+ prgBox ? . Close ( ) ;
200
200
}
201
201
else
202
202
{
@@ -217,7 +217,7 @@ internal async Task InstallOrUpdateAsync(UserPlugin plugin)
217
217
catch ( HttpRequestException e )
218
218
{
219
219
// force close progress box
220
- CleanupProgressBoxEx ( prgBox ) ;
220
+ prgBox ? . Close ( ) ;
221
221
222
222
// show error message
223
223
Context . API . ShowMsgError (
@@ -230,7 +230,7 @@ internal async Task InstallOrUpdateAsync(UserPlugin plugin)
230
230
catch ( Exception e )
231
231
{
232
232
// force close progress box
233
- CleanupProgressBoxEx ( prgBox ) ;
233
+ prgBox ? . Close ( ) ;
234
234
235
235
// show error message
236
236
Context . API . ShowMsgError ( Context . API . GetTranslation ( "plugin_pluginsmanager_install_error_title" ) ,
@@ -256,14 +256,6 @@ internal async Task InstallOrUpdateAsync(UserPlugin plugin)
256
256
}
257
257
}
258
258
259
- private static void CleanupProgressBoxEx ( IProgressBoxEx prgBox )
260
- {
261
- Application . Current . Dispatcher . Invoke ( ( ) =>
262
- {
263
- prgBox ? . Close ( ) ;
264
- } ) ;
265
- }
266
-
267
259
internal async ValueTask < List < Result > > RequestUpdateAsync ( string search , CancellationToken token ,
268
260
bool usePrimaryUrlOnly = false )
269
261
{
You can’t perform that action at this time.
0 commit comments