Skip to content

Commit 8174d54

Browse files
committed
Fix PriorityClick Logic
Use sender to find actual pluginviewmodel instead of use selected
1 parent c5f1b28 commit 8174d54

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

Flow.Launcher/SettingWindow.xaml.cs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
using Flow.Launcher.Plugin.SharedCommands;
1414
using Flow.Launcher.ViewModel;
1515
using Flow.Launcher.Helper;
16+
using System.Windows.Controls;
1617

1718
namespace Flow.Launcher
1819
{
@@ -186,20 +187,18 @@ private void OnPluginToggled(object sender, RoutedEventArgs e)
186187

187188
private void OnPluginPriorityClick(object sender, RoutedEventArgs e)
188189
{
189-
190-
191-
PriorityChangeWindow priorityChangeWindow = new PriorityChangeWindow(viewModel.SelectedPlugin.PluginPair.Metadata.ID, settings, viewModel.SelectedPlugin);
190+
if (sender is Control { DataContext: PluginViewModel pluginViewModel })
191+
{
192+
PriorityChangeWindow priorityChangeWindow = new PriorityChangeWindow(pluginViewModel.PluginPair.Metadata.ID, settings, pluginViewModel);
192193
priorityChangeWindow.ShowDialog();
193-
194+
}
194195
}
195196

196197
private void OnPluginActionKeywordsClick(object sender, RoutedEventArgs e)
197198
{
198-
199-
var id = viewModel.SelectedPlugin.PluginPair.Metadata.ID;
200-
ActionKeywords changeKeywordsWindow = new ActionKeywords(id, settings, viewModel.SelectedPlugin);
201-
changeKeywordsWindow.ShowDialog();
202-
199+
var id = viewModel.SelectedPlugin.PluginPair.Metadata.ID;
200+
ActionKeywords changeKeywordsWindow = new ActionKeywords(id, settings, viewModel.SelectedPlugin);
201+
changeKeywordsWindow.ShowDialog();
203202
}
204203

205204
private void OnPluginNameClick(object sender, MouseButtonEventArgs e)

0 commit comments

Comments
 (0)