diff --git a/src/viewer/KeyShortcuts.tsx b/src/viewer/KeyShortcuts.tsx index bed20eb..f154ee3 100644 --- a/src/viewer/KeyShortcuts.tsx +++ b/src/viewer/KeyShortcuts.tsx @@ -51,7 +51,7 @@ function ControlShortcutEditPopup( title: string} >(null) const actionsByKey = useSelector(selectActionByKeyString) const duplicateActions = keys.map(key => keyToString(key)).flatMap( - keyString => actionsByKey[keyString].filter( + keyString => actionsByKey[keyString]!.filter( a => !(a.action === action && a.shortcutsStateKey === shortcutsStateKey))) const shortcutsPreset = useSelector( @@ -215,7 +215,7 @@ function ControlShortcutEditPopup( (key, index) =>
1, + [css.shortcut_is_duplicate]: key !== "edit" && actionsByKey[keyToString(key)]!.length > 1, })}>
{keyToStringsSpecial( @@ -303,7 +303,7 @@ const ControlShortcut: FunctionComponent = ({ ? CONTROLS[action as ValidControlName] : null const actionsByKey = useSelector(selectActionByKeyString) const duplicateActions = keys.map(key => keyToString(key)).flatMap( - keyString => actionsByKey[keyString].filter( + keyString => actionsByKey[keyString]!.filter( a => !(a.action === action && a.shortcutsStateKey === shortcutsStateKey))) const disabled = useSelector(