fix(shortcuts): Prevent panic when deleting the last keybind of a custom shortcut.

This commit is contained in:
l-const 2024-10-09 14:38:34 +03:00 committed by Michael Murphy
parent d761d763d5
commit a8a7629b6c

View file

@ -321,6 +321,10 @@ impl Model {
if shortcut.is_default {
self.config_add(Action::Disable, shortcut.binding.clone());
} else {
// if last keybind deleted, clear shortcut context
if model.bindings.is_empty() {
self.shortcut_context = None;
}
self.config_remove(&shortcut.binding);
}