fix deleting a key combination (#6843)

This commit is contained in:
James Gatz 2023-11-22 11:20:49 +01:00 committed by GitHub
parent 40de2f4766
commit 7d0b1f8452
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -112,13 +112,15 @@ export const Shortcuts: FC = () => {
withPrompt withPrompt
onClick={() => { onClick={() => {
let toBeRemovedIndex = -1; let toBeRemovedIndex = -1;
keyCombosForThisPlatform.forEach((existingKeyComb, index) => { const keyCombs = getPlatformKeyCombinations(hotKeyRegistry[keyboardShortcut]);
keyCombs.forEach((existingKeyComb, index) => {
if (areSameKeyCombinations(existingKeyComb, keyComb)) { if (areSameKeyCombinations(existingKeyComb, keyComb)) {
toBeRemovedIndex = index; toBeRemovedIndex = index;
} }
}); });
if (toBeRemovedIndex >= 0) { if (toBeRemovedIndex >= 0) {
keyCombosForThisPlatform.splice(toBeRemovedIndex, 1); keyCombs.splice(toBeRemovedIndex, 1);
patchSettings({ hotKeyRegistry }); patchSettings({ hotKeyRegistry });
} }
}} }}