Remove Settings.CustomPluginHotkeys null check

This commit is contained in:
Jack251970 2025-07-02 14:11:18 +08:00
parent 1057f4d2f6
commit d46deddb94
2 changed files with 3 additions and 8 deletions

View file

@ -30,8 +30,6 @@ namespace Flow.Launcher
{
if (!update)
{
_settings.CustomPluginHotkeys ??= new ObservableCollection<CustomPluginHotkey>();
var pluginHotkey = new CustomPluginHotkey
{
Hotkey = HotkeyControl.CurrentHotkey.ToString(), ActionKeyword = tbAction.Text

View file

@ -105,14 +105,11 @@ internal static class HotKeyMapper
new(RegisteredHotkeyType.CycleHistoryUp, HotkeyType.SearchWindow, _settings.CycleHistoryUpHotkey, "CycleHistoryUpHotkey", _mainViewModel.ReverseHistoryCommand, null, () => _settings.CycleHistoryUpHotkey = ""),
new(RegisteredHotkeyType.CycleHistoryDown, HotkeyType.SearchWindow, _settings.CycleHistoryDownHotkey, "CycleHistoryDownHotkey", _mainViewModel.ForwardHistoryCommand, null, () => _settings.CycleHistoryDownHotkey = "")
};
// Custom query global hotkeys
if (_settings.CustomPluginHotkeys != null)
foreach (var customPluginHotkey in _settings.CustomPluginHotkeys)
{
foreach (var customPluginHotkey in _settings.CustomPluginHotkeys)
{
list.Add(new(RegisteredHotkeyType.CustomQuery, HotkeyType.Global, customPluginHotkey.Hotkey, "customQueryHotkey", CustomQueryHotkeyCommand, customPluginHotkey, () => customPluginHotkey.Hotkey = ""));
}
list.Add(new(RegisteredHotkeyType.CustomQuery, HotkeyType.Global, customPluginHotkey.Hotkey, "customQueryHotkey", CustomQueryHotkeyCommand, customPluginHotkey, () => customPluginHotkey.Hotkey = ""));
}
// Plugin hotkeys