diff --git a/Flow.Launcher.Core/Plugin/PluginManager.cs b/Flow.Launcher.Core/Plugin/PluginManager.cs index d94ec8d1d..d5acfcb55 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 => !IsInitFailed(p.Metadata.ID))]; + .Where(p => !_initFailedPlugins.ContainsKey(p.Metadata.ID))]; } } @@ -596,11 +596,24 @@ namespace Flow.Launcher.Core.Plugin #endregion - #region Check Init Failed + #region Check Initializing or Init Failed - public static bool IsInitFailed(string id) + public static bool IsInitializingOrInitFailed(string id) { - return _initFailedPlugins.ContainsKey(id); + // Id does not exist in loaded plugins + if (!_allLoadedPlugins.Any(x => x.Metadata.ID == id)) return false; + + // Plugin initialized already + if (_allInitializedPlugins.ContainsKey(id)) + { + // Check if the plugin initialization failed + return _initFailedPlugins.ContainsKey(id); + } + // Plugin is still initializing + else + { + return true; + } } #endregion diff --git a/Flow.Launcher/ViewModel/PluginViewModel.cs b/Flow.Launcher/ViewModel/PluginViewModel.cs index 4247a5184..acd3902ab 100644 --- a/Flow.Launcher/ViewModel/PluginViewModel.cs +++ b/Flow.Launcher/ViewModel/PluginViewModel.cs @@ -121,7 +121,7 @@ namespace Flow.Launcher.ViewModel public Control BottomPart2 => IsExpanded ? _bottomPart2 ??= new InstalledPluginDisplayBottomData() : null; public bool HasSettingControl => - !PluginManager.IsInitFailed(PluginPair.Metadata.ID) && // Do not show setting panel for init failed plugins + !PluginManager.IsInitializingOrInitFailed(PluginPair.Metadata.ID) && // Do not show setting panel for initializing or init failed plugins PluginPair.Plugin is ISettingProvider && (PluginPair.Plugin is not JsonRPCPluginBase jsonRPCPluginBase || // Is not JsonRPC plugin jsonRPCPluginBase.NeedCreateSettingPanel()); // Is JsonRPC plugin and need to create setting panel