Skip to content

Commit

Permalink
fix(shortcuts): Prevent panic when deleting the last keybind of a cus…
Browse files Browse the repository at this point in the history
…tom shortcut.
  • Loading branch information
l-const committed Oct 9, 2024
1 parent d761d76 commit d2b201d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cosmic-settings/src/pages/input/keyboard/shortcuts/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit d2b201d

Please sign in to comment.