From a160a781902409d0520cdf5acd154651bbff2538 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Fri, 21 Mar 2025 14:46:39 +0800 Subject: [PATCH 1/2] Fix result update interface issue --- Flow.Launcher/App.xaml.cs | 1 + Flow.Launcher/ViewModel/MainViewModel.cs | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Flow.Launcher/App.xaml.cs b/Flow.Launcher/App.xaml.cs index 23c77618f..6649a8110 100644 --- a/Flow.Launcher/App.xaml.cs +++ b/Flow.Launcher/App.xaml.cs @@ -131,6 +131,7 @@ namespace Flow.Launcher Ioc.Default.GetRequiredService().ChangeLanguage(_settings.Language); PluginManager.LoadPlugins(_settings.PluginSettings); + Ioc.Default.GetRequiredService().RegisterResultsUpdatedEvent(); Http.Proxy = _settings.Proxy; diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs index 46970a6a1..452222d93 100644 --- a/Flow.Launcher/ViewModel/MainViewModel.cs +++ b/Flow.Launcher/ViewModel/MainViewModel.cs @@ -168,7 +168,6 @@ namespace Flow.Launcher.ViewModel }; RegisterViewUpdate(); - RegisterResultsUpdatedEvent(); _ = RegisterClockAndDateUpdateAsync(); } @@ -213,7 +212,7 @@ namespace Flow.Launcher.ViewModel } } - private void RegisterResultsUpdatedEvent() + public void RegisterResultsUpdatedEvent() { foreach (var pair in PluginManager.GetPluginsForInterface()) { From b75066f52ceb0b2a140b041aa133454ee56e21a1 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Fri, 21 Mar 2025 15:23:13 +0800 Subject: [PATCH 2/2] Fix change plugin language issue --- Flow.Launcher/App.xaml.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Flow.Launcher/App.xaml.cs b/Flow.Launcher/App.xaml.cs index 6649a8110..377d36c48 100644 --- a/Flow.Launcher/App.xaml.cs +++ b/Flow.Launcher/App.xaml.cs @@ -127,12 +127,15 @@ namespace Flow.Launcher AbstractPluginEnvironment.PreStartPluginExecutablePathUpdate(_settings); + PluginManager.LoadPlugins(_settings.PluginSettings); + + // Register ResultsUpdated event after all plugins are loaded + Ioc.Default.GetRequiredService().RegisterResultsUpdatedEvent(); + + // Change language after all plugins are initialized // TODO: Clean InternationalizationManager.Instance and InternationalizationManager.Instance.GetTranslation in future Ioc.Default.GetRequiredService().ChangeLanguage(_settings.Language); - PluginManager.LoadPlugins(_settings.PluginSettings); - Ioc.Default.GetRequiredService().RegisterResultsUpdatedEvent(); - Http.Proxy = _settings.Proxy; await PluginManager.InitializePluginsAsync();