Don't await download manifest when it is unavaliable, but only await when calling install method to allow user using uninstall when manifest is not ready.

This commit is contained in:
弘韬 张 2021-01-25 17:18:48 +08:00
parent 267c796ad8
commit 5d894ec154
2 changed files with 15 additions and 4 deletions

View file

@ -69,8 +69,19 @@ namespace Flow.Launcher.Plugin.PluginsManager
if ((DateTime.Now - lastUpdateTime).TotalHours > 12) // 12 hours
{
await pluginManager.UpdateManifest();
lastUpdateTime = DateTime.Now;
_ = pluginManager.UpdateManifest().ContinueWith(t =>
{
if (t.IsCompletedSuccessfully)
{
lastUpdateTime = DateTime.Now;
}
else
{
Context.API.ShowMsg("Plugin Manifest Download Fail.",
"Please check if you can connect to github.com. " +
"This error means you may not be able to Install and Update Plugin.", pluginManager.icoPath, false);
}
});
}
return search switch

View file

@ -46,9 +46,9 @@ namespace Flow.Launcher.Plugin.PluginsManager
Settings = settings;
}
internal async Task UpdateManifest()
internal Task UpdateManifest()
{
await pluginsManifest.DownloadManifest();
return _downloadManifestTask = pluginsManifest.DownloadManifest();
}
internal List<Result> GetDefaultHotKeys()