diff --git a/Pal.Client/Commands/PalConfigCommand.cs b/Pal.Client/Commands/PalConfigCommand.cs index 74218e1..e2f9432 100644 --- a/Pal.Client/Commands/PalConfigCommand.cs +++ b/Pal.Client/Commands/PalConfigCommand.cs @@ -29,7 +29,7 @@ namespace Pal.Client.Commands { "", _ => Execute() } }; - private void Execute() + public void Execute() { if (_configuration.FirstUse) _agreementWindow.IsOpen = true; diff --git a/Pal.Client/DependencyInjectionContext.cs b/Pal.Client/DependencyInjectionContext.cs index 9632c3b..7ae62e4 100644 --- a/Pal.Client/DependencyInjectionContext.cs +++ b/Pal.Client/DependencyInjectionContext.cs @@ -113,6 +113,7 @@ namespace Pal.Client _serviceCollection.AddTransient(); // commands + _serviceCollection.AddScoped(); _serviceCollection.AddScoped(); _serviceCollection.AddScoped(); _serviceCollection.AddScoped(); diff --git a/Pal.Client/Plugin.cs b/Pal.Client/Plugin.cs index 09a3d0e..312f23f 100644 --- a/Pal.Client/Plugin.cs +++ b/Pal.Client/Plugin.cs @@ -193,14 +193,7 @@ namespace Pal.Client } private void OpenConfigUi() - { - _rootScope!.ServiceProvider.GetRequiredService>() - .SelectMany(cmd => cmd.GetHandlers()) - .Where(cmd => cmd.Key == "config") - .Select(cmd => cmd.Value) - .Single() - .Invoke("config"); - } + => _rootScope!.ServiceProvider.GetRequiredService().Execute(); private void LanguageChanged(string languageCode) {