Skip to content

Commit c03a0b0

Browse files
Validate hotkey before setting
1 parent 72f8b9e commit c03a0b0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Flow.Launcher/HotkeyControl.xaml.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public async Task SetHotkeyAsync(HotkeyModel keyModel, bool triggerValidate = tr
7070

7171
if (triggerValidate)
7272
{
73-
bool hotkeyAvailable = keyModel.CharKey != Key.None && CheckHotkeyAvailability(keyModel);
73+
bool hotkeyAvailable = CheckHotkeyAvailability(keyModel);
7474
SetMessage(hotkeyAvailable);
7575
OnHotkeyChanged();
7676

@@ -88,7 +88,7 @@ public Task SetHotkeyAsync(string keyStr, bool triggerValidate = true)
8888
return SetHotkeyAsync(new HotkeyModel(keyStr), triggerValidate);
8989
}
9090

91-
private bool CheckHotkeyAvailability() => HotKeyMapper.CheckAvailability(CurrentHotkey);
91+
private static bool CheckHotkeyAvailability(HotkeyModel hotkey) => hotkey.Validate() && HotKeyMapper.CheckAvailability(hotkey);
9292

9393
public new bool IsFocused => tbHotkey.IsFocused;
9494

0 commit comments

Comments
 (0)