fix: lost focus change current hotkey before stop recording store that

This commit is contained in:
Hongtao Zhang 2024-04-13 13:06:04 -05:00
parent b7ccab67d1
commit c39da2f5f3

View file

@ -116,6 +116,8 @@ namespace Flow.Launcher.ViewModel
SetKeysToDisplay(KeysToDisplay, CurrentHotkey);
return;
}
Hotkey = CurrentHotkey.ToString();
await SetHotkeyAsync(CurrentHotkey, true);
}
@ -146,20 +148,17 @@ namespace Flow.Launcher.ViewModel
if (triggerValidate)
{
bool hotkeyAvailable = CheckHotkeyAvailability(keyModel, ValidateKeyGesture);
CurrentHotkeyAvailable = hotkeyAvailable;
SetMessage(hotkeyAvailable ? "success" : "hotkeyUnavailable", !hotkeyAvailable);
HotkeyDelegate?.Invoke(keyModel);
if (CurrentHotkeyAvailable)
{
CurrentHotkey = keyModel;
Hotkey = keyModel.ToString();
SetKeysToDisplay(KeysToDisplay, CurrentHotkey);
}
}
else
{
CurrentHotkey = keyModel;
Hotkey = keyModel.ToString();
}
}