Skip to content

Commit 67c940f

Browse files
committed
Do not show setting panel for init failed plugins
1 parent 324b3eb commit 67c940f

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

Flow.Launcher.Core/Plugin/PluginManager.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ public static List<PluginPair> GetAllInitializedPlugins(bool containFailed)
533533
else
534534
{
535535
return [.. _allInitializedPlugins.Values
536-
.Where(p => !_initFailedPlugins.ContainsKey(p.Metadata.ID))];
536+
.Where(p => !IsInitFailed(p.Metadata.ID))];
537537
}
538538
}
539539

@@ -596,6 +596,15 @@ public static bool IsHomePlugin(string id)
596596

597597
#endregion
598598

599+
#region Check Init Failed
600+
601+
public static bool IsInitFailed(string id)
602+
{
603+
return _initFailedPlugins.ContainsKey(id);
604+
}
605+
606+
#endregion
607+
599608
#region Plugin Action Keyword
600609

601610
public static bool ActionKeywordRegistered(string actionKeyword)

Flow.Launcher/ViewModel/PluginViewModel.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,9 @@ public double PluginSearchDelayTime
121121
public Control BottomPart2 => IsExpanded ? _bottomPart2 ??= new InstalledPluginDisplayBottomData() : null;
122122

123123
public bool HasSettingControl => PluginPair.Plugin is ISettingProvider &&
124+
PluginManager.IsInitFailed(PluginPair.Metadata.ID) && // Do not show setting panel for init failed plugins
124125
(PluginPair.Plugin is not JsonRPCPluginBase jsonRPCPluginBase || jsonRPCPluginBase.NeedCreateSettingPanel());
126+
125127
public Control SettingControl
126128
=> IsExpanded
127129
? _settingControl

0 commit comments

Comments
 (0)