Merge pull request #300 from Flow-Launcher/fix_errormsg_delay

fix error message not working + increase delay
This commit is contained in:
taooceros 2021-01-21 11:05:07 +08:00 committed by GitHub
commit 79962fb03e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 11 deletions

View file

@ -30,7 +30,7 @@ namespace Flow.Launcher.Plugin.PluginsManager
return new PluginsManagerSettings(viewModel);
}
public async Task InitAsync(PluginInitContext context)
public Task InitAsync(PluginInitContext context)
{
Context = context;
viewModel = new SettingsViewModel(context);
@ -38,16 +38,21 @@ namespace Flow.Launcher.Plugin.PluginsManager
contextMenu = new ContextMenu(Context);
pluginManager = new PluginsManager(Context, Settings);
var updateManifestTask = pluginManager.UpdateManifest();
if (await Task.WhenAny(updateManifestTask, Task.Delay(500)) == updateManifestTask)
_ = updateManifestTask.ContinueWith(t =>
{
lastUpdateTime = DateTime.Now;
}
else
{
context.API.ShowMsg("Plugin Manifest Download Fail.",
@"Please check internet transmission with Github.com.
You may not be able to Install and Update Plugin.", pluginManager.icoPath);
}
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 Task.CompletedTask;
}
public List<Result> LoadContextMenus(Result selectedResult)

View file

@ -6,7 +6,7 @@
"Name": "Plugins Manager",
"Description": "Management of installing, uninstalling or updating Flow Launcher plugins",
"Author": "Jeremy Wu",
"Version": "1.6.0",
"Version": "1.6.1",
"Language": "csharp",
"Website": "https://github.com/Flow-Launcher/Flow.Launcher",
"ExecuteFileName": "Flow.Launcher.Plugin.PluginsManager.dll",