From 319f016ced396ee6dd961096140e8b9ca25a1b52 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Mon, 10 Feb 2025 12:01:21 +0800 Subject: [PATCH] Remove unnessary list refresh --- Flow.Launcher.Core/ExternalPlugins/PluginsManifest.cs | 6 +++++- .../ViewModels/SettingsPanePluginStoreViewModel.cs | 6 ++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Flow.Launcher.Core/ExternalPlugins/PluginsManifest.cs b/Flow.Launcher.Core/ExternalPlugins/PluginsManifest.cs index 54080e150..ac8abcdcc 100644 --- a/Flow.Launcher.Core/ExternalPlugins/PluginsManifest.cs +++ b/Flow.Launcher.Core/ExternalPlugins/PluginsManifest.cs @@ -21,7 +21,7 @@ namespace Flow.Launcher.Core.ExternalPlugins public static List UserPlugins { get; private set; } - public static async Task UpdateManifestAsync(CancellationToken token = default, bool usePrimaryUrlOnly = false) + public static async Task UpdateManifestAsync(CancellationToken token = default, bool usePrimaryUrlOnly = false) { try { @@ -36,6 +36,8 @@ namespace Flow.Launcher.Core.ExternalPlugins { UserPlugins = results; lastFetchedAt = DateTime.Now; + + return true; } } } @@ -47,6 +49,8 @@ namespace Flow.Launcher.Core.ExternalPlugins { manifestUpdateLock.Release(); } + + return false; } } } diff --git a/Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginStoreViewModel.cs b/Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginStoreViewModel.cs index a6cc3c535..15579a61d 100644 --- a/Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginStoreViewModel.cs +++ b/Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginStoreViewModel.cs @@ -24,8 +24,10 @@ public partial class SettingsPanePluginStoreViewModel : BaseModel [RelayCommand] private async Task RefreshExternalPluginsAsync() { - await PluginsManifest.UpdateManifestAsync(); - OnPropertyChanged(nameof(ExternalPlugins)); + if (await PluginsManifest.UpdateManifestAsync()) + { + OnPropertyChanged(nameof(ExternalPlugins)); + } } public bool SatisfiesFilter(PluginStoreItemViewModel plugin)