Skip to content

Commit

Permalink
fix deleting a key combination (Kong#6843)
Browse files Browse the repository at this point in the history
  • Loading branch information
gatzjames authored and jackkav committed Mar 13, 2024
1 parent 491feab commit c52a0d5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/insomnia/src/ui/components/settings/shortcuts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,15 @@ export const Shortcuts: FC = () => {
withPrompt
onClick={() => {
let toBeRemovedIndex = -1;
keyCombosForThisPlatform.forEach((existingKeyComb, index) => {
const keyCombs = getPlatformKeyCombinations(hotKeyRegistry[keyboardShortcut]);
keyCombs.forEach((existingKeyComb, index) => {
if (areSameKeyCombinations(existingKeyComb, keyComb)) {
toBeRemovedIndex = index;
}
});
if (toBeRemovedIndex >= 0) {
keyCombosForThisPlatform.splice(toBeRemovedIndex, 1);
keyCombs.splice(toBeRemovedIndex, 1);

patchSettings({ hotKeyRegistry });
}
}}
Expand Down

0 comments on commit c52a0d5

Please sign in to comment.