diff --git a/Flow.Launcher.Core/Plugin/PluginManager.cs b/Flow.Launcher.Core/Plugin/PluginManager.cs index 8b662edab..dadf4b615 100644 --- a/Flow.Launcher.Core/Plugin/PluginManager.cs +++ b/Flow.Launcher.Core/Plugin/PluginManager.cs @@ -665,7 +665,7 @@ namespace Flow.Launcher.Core.Plugin #endregion - #region Check Initializing or Init Failed + #region Check Initializing & Init Failed public static bool IsInitializingOrInitFailed(string id) { @@ -685,6 +685,41 @@ namespace Flow.Launcher.Core.Plugin } } + public static bool IsInitializing(string id) + { + // Id does not exist in loaded plugins + if (!_allLoadedPlugins.Any(x => x.Value.Metadata.ID == id)) return false; + + // Plugin initialized already + if (_allInitializedPlugins.ContainsKey(id)) + { + return false; + } + // Plugin is still initializing + else + { + return true; + } + } + + public static bool IsInitializationFailed(string id) + { + // Id does not exist in loaded plugins + if (!_allLoadedPlugins.Any(x => x.Value.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 false; + } + } + #endregion #region Plugin Action Keyword