From 67c940f3a8f20351369d4516ab353a495ea8543f Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Mon, 21 Jul 2025 17:45:01 +0800 Subject: [PATCH] Do not show setting panel for init failed plugins --- Flow.Launcher.Core/Plugin/PluginManager.cs | 11 ++++++++++- Flow.Launcher/ViewModel/PluginViewModel.cs | 2 ++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Flow.Launcher.Core/Plugin/PluginManager.cs b/Flow.Launcher.Core/Plugin/PluginManager.cs index f69a4ba0a..3ba89fce6 100644 --- a/Flow.Launcher.Core/Plugin/PluginManager.cs +++ b/Flow.Launcher.Core/Plugin/PluginManager.cs @@ -533,7 +533,7 @@ namespace Flow.Launcher.Core.Plugin else { return [.. _allInitializedPlugins.Values - .Where(p => !_initFailedPlugins.ContainsKey(p.Metadata.ID))]; + .Where(p => !IsInitFailed(p.Metadata.ID))]; } } @@ -596,6 +596,15 @@ namespace Flow.Launcher.Core.Plugin #endregion + #region Check Init Failed + + public static bool IsInitFailed(string id) + { + return _initFailedPlugins.ContainsKey(id); + } + + #endregion + #region Plugin Action Keyword public static bool ActionKeywordRegistered(string actionKeyword) diff --git a/Flow.Launcher/ViewModel/PluginViewModel.cs b/Flow.Launcher/ViewModel/PluginViewModel.cs index ea222d023..5fc3cd0cd 100644 --- a/Flow.Launcher/ViewModel/PluginViewModel.cs +++ b/Flow.Launcher/ViewModel/PluginViewModel.cs @@ -121,7 +121,9 @@ namespace Flow.Launcher.ViewModel public Control BottomPart2 => IsExpanded ? _bottomPart2 ??= new InstalledPluginDisplayBottomData() : null; public bool HasSettingControl => PluginPair.Plugin is ISettingProvider && + PluginManager.IsInitFailed(PluginPair.Metadata.ID) && // Do not show setting panel for init failed plugins (PluginPair.Plugin is not JsonRPCPluginBase jsonRPCPluginBase || jsonRPCPluginBase.NeedCreateSettingPanel()); + public Control SettingControl => IsExpanded ? _settingControl