From f0267475f520f9bd53981201dabc72e22877e2c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?= Date: Tue, 29 Dec 2020 12:23:15 +0800 Subject: [PATCH] Change call method for default hotkeys. Remove extra whitespace add await using for stream --- Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs | 4 ++-- .../Models/PluginsManifest.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs index 8d99bf37d..607b2e3f5 100644 --- a/Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs @@ -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; diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/Models/PluginsManifest.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/Models/PluginsManifest.cs index 2ab8806bc..c854b213d 100644 --- a/Plugins/Flow.Launcher.Plugin.PluginsManager/Models/PluginsManifest.cs +++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/Models/PluginsManifest.cs @@ -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>(jsonStream).ConfigureAwait(false); @@ -33,4 +33,4 @@ namespace Flow.Launcher.Plugin.PluginsManager.Models } } -} +} \ No newline at end of file