fix: hotkeys setting from pwsp-gui (#56)

* refactor: do not overwrite incorrect hotkeys config

* fix: hotkeys not saved via pwsp-gui
This commit is contained in:
Tarasov Aleksandr
2026-04-12 17:05:10 +03:00
committed by GitHub
parent cb56cb3a04
commit 42c0170044
6 changed files with 119 additions and 26 deletions
+1 -2
View File
@@ -98,7 +98,6 @@ impl GuiConfig {
pub struct HotkeySlot {
pub slot: String,
pub action: Request,
#[serde(skip_serializing_if = "Option::is_none")]
pub key_chord: Option<String>,
}
@@ -121,7 +120,7 @@ impl HotkeyConfig {
let bytes = fs::read(&path)?;
match serde_json::from_slice::<HotkeyConfig>(&bytes) {
Ok(config) => Ok(config),
Err(_) => Ok(HotkeyConfig::default()),
Err(e) => Err(e.into()),
}
}