diff --git a/code/core/src/manager/settings/shortcuts.tsx b/code/core/src/manager/settings/shortcuts.tsx index 33a29e239ba7..9713715f3155 100644 --- a/code/core/src/manager/settings/shortcuts.tsx +++ b/code/core/src/manager/settings/shortcuts.tsx @@ -287,8 +287,14 @@ class ShortcutsScreen extends Component { const { shortcutKeys, addonsShortcutLabels } = this.state; - // @ts-expect-error (non strict) - const arr = Object.entries(shortcutKeys).map(([feature, { shortcut }]: [Feature, any]) => ( + // Filter out keyboard shortcuts from localStorage that no longer exist in code + const availableShortcuts = (Object.entries(shortcutKeys) as [Feature, any][]).filter( + ([feature]: [Feature, any]) => + shortcutLabels[feature] !== undefined || + (addonsShortcutLabels && addonsShortcutLabels[feature]) + ); + + const arr = availableShortcuts.map(([feature, { shortcut }]: [Feature, any]) => ( {/* @ts-expect-error (non strict) */} {shortcutLabels[feature] || addonsShortcutLabels[feature]}