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 23c77618f5d..6649a811035 100644 --- a/Flow.Launcher/App.xaml.cs +++ b/Flow.Launcher/App.xaml.cs @@ -131,6 +131,7 @@ await Stopwatch.NormalAsync("|App.OnStartup|Startup cost", async () => 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 46970a6a13f..452222d93b2 100644 --- a/Flow.Launcher/ViewModel/MainViewModel.cs +++ b/Flow.Launcher/ViewModel/MainViewModel.cs @@ -168,7 +168,6 @@ public MainViewModel() }; RegisterViewUpdate(); - RegisterResultsUpdatedEvent(); _ = RegisterClockAndDateUpdateAsync(); } @@ -213,7 +212,7 @@ void continueAction(Task t) } } - 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 6649a811035..377d36c4895 100644 --- a/Flow.Launcher/App.xaml.cs +++ b/Flow.Launcher/App.xaml.cs @@ -127,12 +127,15 @@ await Stopwatch.NormalAsync("|App.OnStartup|Startup cost", async () => AbstractPluginEnvironment.PreStartPluginExecutablePathUpdate(_settings); - // TODO: Clean InternationalizationManager.Instance and InternationalizationManager.Instance.GetTranslation in future - Ioc.Default.GetRequiredService().ChangeLanguage(_settings.Language); - 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); + Http.Proxy = _settings.Proxy; await PluginManager.InitializePluginsAsync();