Skip to content

Commit c7bc02d

Browse files
committed
PluginSettingsWindow: Remove constructor that could lead to invalid state and merge LoadPlugin Method into remaining constructor
1 parent 8823d5e commit c7bc02d

1 file changed

Lines changed: 3 additions & 11 deletions

File tree

Flow.Launcher/PluginSettingsWindow.xaml.cs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,10 @@ public partial class PluginSettingsWindow
1313
{
1414
private readonly Settings _settings;
1515

16-
public PluginSettingsWindow()
17-
{
18-
_settings = Ioc.Default.GetRequiredService<Settings>();
19-
InitializeComponent();
20-
}
21-
2216
public PluginSettingsWindow(string pluginId)
23-
: this()
2417
{
25-
LoadPlugin(pluginId);
26-
}
18+
_settings = Ioc.Default.GetRequiredService<Settings>();
2719

28-
private void LoadPlugin(string pluginId)
29-
{
3020
if (string.IsNullOrWhiteSpace(pluginId))
3121
{
3222
App.API.ShowMsgError("Plugin settings", "Invalid plugin id.");
@@ -56,6 +46,8 @@ private void LoadPlugin(string pluginId)
5646

5747
DataContext = pluginViewModel;
5848
Title = $"{pluginPair.Metadata.Name} Settings";
49+
50+
InitializeComponent();
5951
}
6052

6153
// This is used for Priority control to force its value to be 0 when the user clears the value.

0 commit comments

Comments
 (0)