Skip to content

Commit 79962fb

Browse files
authored
Merge pull request #300 from Flow-Launcher/fix_errormsg_delay
fix error message not working + increase delay
2 parents 29a2713 + 49d5fae commit 79962fb

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,29 @@ public Control CreateSettingPanel()
3030
return new PluginsManagerSettings(viewModel);
3131
}
3232

33-
public async Task InitAsync(PluginInitContext context)
33+
public Task InitAsync(PluginInitContext context)
3434
{
3535
Context = context;
3636
viewModel = new SettingsViewModel(context);
3737
Settings = viewModel.Settings;
3838
contextMenu = new ContextMenu(Context);
3939
pluginManager = new PluginsManager(Context, Settings);
4040
var updateManifestTask = pluginManager.UpdateManifest();
41-
if (await Task.WhenAny(updateManifestTask, Task.Delay(500)) == updateManifestTask)
41+
_ = updateManifestTask.ContinueWith(t =>
4242
{
43-
lastUpdateTime = DateTime.Now;
44-
}
45-
else
46-
{
47-
context.API.ShowMsg("Plugin Manifest Download Fail.",
48-
@"Please check internet transmission with Github.com.
49-
You may not be able to Install and Update Plugin.", pluginManager.icoPath);
50-
}
43+
if (t.IsCompletedSuccessfully)
44+
{
45+
lastUpdateTime = DateTime.Now;
46+
}
47+
else
48+
{
49+
context.API.ShowMsg("Plugin Manifest Download Fail.",
50+
"Please check if you can connect to github.com. " +
51+
"This error means you may not be able to Install and Update Plugin.", pluginManager.icoPath, false);
52+
}
53+
});
54+
55+
return Task.CompletedTask;
5156
}
5257

5358
public List<Result> LoadContextMenus(Result selectedResult)

Plugins/Flow.Launcher.Plugin.PluginsManager/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"Name": "Plugins Manager",
77
"Description": "Management of installing, uninstalling or updating Flow Launcher plugins",
88
"Author": "Jeremy Wu",
9-
"Version": "1.6.0",
9+
"Version": "1.6.1",
1010
"Language": "csharp",
1111
"Website": "https://github.com/Flow-Launcher/Flow.Launcher",
1212
"ExecuteFileName": "Flow.Launcher.Plugin.PluginsManager.dll",

0 commit comments

Comments
 (0)