fix(shortcuts): Prevent panic when deleting the last keybind of a custom shortcut.
This commit is contained in:
parent
d761d763d5
commit
a8a7629b6c
1 changed files with 4 additions and 0 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue