Change call method for default hotkeys.

Remove extra whitespace
add await using for stream
This commit is contained in:
弘韬 张 2020-12-29 12:23:15 +08:00
parent f32e202746
commit f0267475f5
2 changed files with 4 additions and 4 deletions

View file

@ -50,7 +50,7 @@ namespace Flow.Launcher.Plugin.PluginsManager
var search = query.Search.ToLower();
if (string.IsNullOrWhiteSpace(search))
return Settings.HotKeys;
return pluginManager.GetDefaultHotKeys();
if ((DateTime.Now - _lastUpdateTime).TotalHours > 12) // 12 hours
{
@ -66,7 +66,7 @@ namespace Flow.Launcher.Plugin.PluginsManager
var s when s.StartsWith(Settings.HotKeyInstall) => pluginManager.RequestInstallOrUpdate(s),
var s when s.StartsWith(Settings.HotkeyUninstall) => pluginManager.RequestUninstall(s),
var s when s.StartsWith(Settings.HotkeyUpdate) => pluginManager.RequestUpdate(s),
_ => Settings.HotKeys.Where(hotkey =>
_ => pluginManager.GetDefaultHotKeys().Where(hotkey =>
{
hotkey.Score = StringMatcher.FuzzySearch(search, hotkey.Title).Score;
return hotkey.Score > 0;

View file

@ -19,7 +19,7 @@ namespace Flow.Launcher.Plugin.PluginsManager.Models
{
try
{
var jsonStream = await Http.GetStreamAsync("https://raw.githubusercontent.com/Flow-Launcher/Flow.Launcher.PluginsManifest/main/plugins.json")
await using var jsonStream = await Http.GetStreamAsync("https://raw.githubusercontent.com/Flow-Launcher/Flow.Launcher.PluginsManifest/main/plugins.json")
.ConfigureAwait(false);
UserPlugins = await JsonSerializer.DeserializeAsync<List<UserPlugin>>(jsonStream).ConfigureAwait(false);
@ -33,4 +33,4 @@ namespace Flow.Launcher.Plugin.PluginsManager.Models
}
}
}
}