|
1 |
| -using Flow.Launcher.Core.ExternalPlugins; |
| 1 | +using Flow.Launcher.Core.ExternalPlugins; |
2 | 2 | using Flow.Launcher.Core.Plugin;
|
3 | 3 | using Flow.Launcher.Infrastructure;
|
4 | 4 | using Flow.Launcher.Infrastructure.Http;
|
@@ -49,26 +49,6 @@ internal PluginsManager(PluginInitContext context, Settings settings)
|
49 | 49 | Settings = settings;
|
50 | 50 | }
|
51 | 51 |
|
52 |
| - private Task _downloadManifestTask = Task.CompletedTask; |
53 |
| - |
54 |
| - internal Task UpdateManifestAsync(CancellationToken token = default, bool silent = false) |
55 |
| - { |
56 |
| - if (_downloadManifestTask.Status == TaskStatus.Running) |
57 |
| - { |
58 |
| - return _downloadManifestTask; |
59 |
| - } |
60 |
| - else |
61 |
| - { |
62 |
| - _downloadManifestTask = PluginsManifest.UpdateManifestAsync(token); |
63 |
| - if (!silent) |
64 |
| - _downloadManifestTask.ContinueWith(_ => |
65 |
| - Context.API.ShowMsg(Context.API.GetTranslation("plugin_pluginsmanager_update_failed_title"), |
66 |
| - Context.API.GetTranslation("plugin_pluginsmanager_update_failed_subtitle"), icoPath, false), |
67 |
| - TaskContinuationOptions.OnlyOnFaulted); |
68 |
| - return _downloadManifestTask; |
69 |
| - } |
70 |
| - } |
71 |
| - |
72 | 52 | internal List<Result> GetDefaultHotKeys()
|
73 | 53 | {
|
74 | 54 | return new List<Result>()
|
@@ -184,7 +164,7 @@ internal async Task InstallOrUpdateAsync(UserPlugin plugin)
|
184 | 164 |
|
185 | 165 | internal async ValueTask<List<Result>> RequestUpdateAsync(string search, CancellationToken token)
|
186 | 166 | {
|
187 |
| - await UpdateManifestAsync(token); |
| 167 | + await PluginsManifest.UpdateManifestAsync(token); |
188 | 168 |
|
189 | 169 | var resultsForUpdate =
|
190 | 170 | from existingPlugin in Context.API.GetAllPlugins()
|
@@ -359,7 +339,7 @@ private bool InstallSourceKnown(string url)
|
359 | 339 |
|
360 | 340 | internal async ValueTask<List<Result>> RequestInstallOrUpdate(string search, CancellationToken token)
|
361 | 341 | {
|
362 |
| - await UpdateManifestAsync(token); |
| 342 | + await PluginsManifest.UpdateManifestAsync(token); |
363 | 343 |
|
364 | 344 | if (Uri.IsWellFormedUriString(search, UriKind.Absolute)
|
365 | 345 | && search.Split('.').Last() == zip)
|
|
0 commit comments