diff --git a/ElectronClient/gui/KeymapConfig/KeymapConfigScreen.tsx b/ElectronClient/gui/KeymapConfig/KeymapConfigScreen.tsx index 55a5ed2310a..29dafdd9203 100644 --- a/ElectronClient/gui/KeymapConfig/KeymapConfigScreen.tsx +++ b/ElectronClient/gui/KeymapConfig/KeymapConfigScreen.tsx @@ -62,7 +62,9 @@ export const KeymapConfigScreen = ({ themeId }: KeymapConfigScreenProps) => { return (recorderError && ); } else if (hovering[commandName]) { return (); - } else { return null; } + } else { + return null; + } }; const renderError = (error: KeymapError) => { @@ -89,7 +91,7 @@ export const KeymapConfigScreen = ({ themeId }: KeymapConfigScreenProps) => { onReset={handleReset} onCancel={handleCancel} onError={handleError} - initialAccelerator={accelerator} + initialAccelerator={accelerator || ''} commandName={command} themeId={themeId} /> : diff --git a/ElectronClient/gui/KeymapConfig/ShortcutRecorder.tsx b/ElectronClient/gui/KeymapConfig/ShortcutRecorder.tsx index fb1ff66e80f..f2c4308b85f 100644 --- a/ElectronClient/gui/KeymapConfig/ShortcutRecorder.tsx +++ b/ElectronClient/gui/KeymapConfig/ShortcutRecorder.tsx @@ -25,8 +25,11 @@ export const ShortcutRecorder = ({ onSave, onReset, onCancel, onError, initialAc useEffect(() => { try { - keymapService.validateAccelerator(accelerator); - keymapService.validateKeymap({ accelerator, command: commandName }); + if (accelerator) { + keymapService.validateAccelerator(accelerator); + keymapService.validateKeymap({ accelerator, command: commandName }); + } + // Discard previous errors onError({ recorderError: null }); setSaveAllowed(true);