mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-02-12 19:01:36 +00:00
Add check for Shortcut::None when registering a shortcut
This commit is contained in:
parent
be381e8cf9
commit
da8a5e952b
@ -745,6 +745,14 @@ pub fn register_shortcut(_token: APIToken, payload: Json<RegisterShortcutRequest
|
|||||||
let id = payload.id;
|
let id = payload.id;
|
||||||
let new_shortcut = payload.shortcut.clone();
|
let new_shortcut = payload.shortcut.clone();
|
||||||
|
|
||||||
|
if id == Shortcut::None {
|
||||||
|
error!(Source = "Tauri"; "Cannot register NONE shortcut.");
|
||||||
|
return Json(ShortcutResponse {
|
||||||
|
success: false,
|
||||||
|
error_message: "Cannot register NONE shortcut".to_string(),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
info!(Source = "Tauri"; "Registering global shortcut '{}' with key '{new_shortcut}'.", id);
|
info!(Source = "Tauri"; "Registering global shortcut '{}' with key '{new_shortcut}'.", id);
|
||||||
|
|
||||||
// Get the main window to access the global shortcut manager:
|
// Get the main window to access the global shortcut manager:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user