mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Change the place of Wait in PluginManifest to make code more elegent
This commit is contained in:
parent
85f5766022
commit
96609f797e
1 changed files with 6 additions and 9 deletions
|
|
@ -10,21 +10,19 @@ namespace Flow.Launcher.Plugin.PluginsManager.Models
|
|||
internal class PluginsManifest
|
||||
{
|
||||
internal List<UserPlugin> UserPlugins { get; private set; }
|
||||
|
||||
internal PluginsManifest()
|
||||
{
|
||||
DownloadManifest();
|
||||
DownloadManifest().Wait();
|
||||
}
|
||||
|
||||
private void DownloadManifest()
|
||||
private async Task DownloadManifest()
|
||||
{
|
||||
var json = string.Empty;
|
||||
try
|
||||
{
|
||||
var t = Task.Run(
|
||||
async () =>
|
||||
json = await Http.Get("https://raw.githubusercontent.com/Flow-Launcher/Flow.Launcher.PluginsManifest/main/plugins.json"));
|
||||
|
||||
t.Wait();
|
||||
json = await Http.Get(
|
||||
"https://raw.githubusercontent.com/Flow-Launcher/Flow.Launcher.PluginsManifest/main/plugins.json");
|
||||
|
||||
UserPlugins = JsonConvert.DeserializeObject<List<UserPlugin>>(json);
|
||||
}
|
||||
|
|
@ -34,7 +32,6 @@ namespace Flow.Launcher.Plugin.PluginsManager.Models
|
|||
|
||||
UserPlugins = new List<UserPlugin>();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue