From 7d0b1f845253033bf74e63123acd51d411e6e7e1 Mon Sep 17 00:00:00 2001 From: James Gatz Date: Wed, 22 Nov 2023 11:20:49 +0100 Subject: [PATCH] fix deleting a key combination (#6843) --- packages/insomnia/src/ui/components/settings/shortcuts.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/insomnia/src/ui/components/settings/shortcuts.tsx b/packages/insomnia/src/ui/components/settings/shortcuts.tsx index ec7f46c21..7c6544d72 100644 --- a/packages/insomnia/src/ui/components/settings/shortcuts.tsx +++ b/packages/insomnia/src/ui/components/settings/shortcuts.tsx @@ -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 }); } }}