diff --git a/ElectronClient/gui/KeymapConfig/KeymapConfigScreen.tsx b/ElectronClient/gui/KeymapConfig/KeymapConfigScreen.tsx index b4987327af..9d80b727e1 100644 --- a/ElectronClient/gui/KeymapConfig/KeymapConfigScreen.tsx +++ b/ElectronClient/gui/KeymapConfig/KeymapConfigScreen.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import { useState } from 'react'; -import KeymapService, { KeymapItem } from '../../lib/services/KeymapService'; +import KeymapService, { KeymapItem } from 'lib/services/KeymapService'; import { ShortcutRecorder } from './ShortcutRecorder'; import getLabel from './utils/getLabel'; import useKeymap from './utils/useKeymap'; @@ -106,7 +106,7 @@ export const KeymapConfigScreen = ({ themeId }: KeymapConfigScreenProps) => { const renderError = (error: Error) => { return ( -
+

{error.message} diff --git a/ElectronClient/gui/KeymapConfig/ShortcutRecorder.tsx b/ElectronClient/gui/KeymapConfig/ShortcutRecorder.tsx index e180ad74c5..0db2a1dc3c 100644 --- a/ElectronClient/gui/KeymapConfig/ShortcutRecorder.tsx +++ b/ElectronClient/gui/KeymapConfig/ShortcutRecorder.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import { useState, useEffect, KeyboardEvent } from 'react'; -import KeymapService from '../../lib/services/KeymapService'; +import KeymapService from 'lib/services/KeymapService'; import styles_ from './styles'; import { _ } from 'lib/locale'; diff --git a/ElectronClient/gui/KeymapConfig/utils/useKeymap.ts b/ElectronClient/gui/KeymapConfig/utils/useKeymap.ts index 5bbcacfb08..7ce015b22d 100644 --- a/ElectronClient/gui/KeymapConfig/utils/useKeymap.ts +++ b/ElectronClient/gui/KeymapConfig/utils/useKeymap.ts @@ -1,5 +1,5 @@ import { useState, useEffect } from 'react'; -import KeymapService, { KeymapItem } from '../../../lib/services/KeymapService'; +import KeymapService, { KeymapItem } from 'lib/services/KeymapService'; const keymapService = KeymapService.instance(); @@ -70,7 +70,8 @@ const useKeymap = (): [ await keymapService.saveCustomKeymap(); setKeymapError(null); } catch (err) { - setKeymapError(err); + const error = new Error(`Could not save file: ${err.message}`); + setKeymapError(error); } } diff --git a/ReactNativeClient/lib/services/KeymapService.ts b/ReactNativeClient/lib/services/KeymapService.ts index d090b26a1b..e674b4fe6f 100644 --- a/ReactNativeClient/lib/services/KeymapService.ts +++ b/ReactNativeClient/lib/services/KeymapService.ts @@ -51,7 +51,7 @@ const defaultKeymapItems = { { accelerator: 'Ctrl+N', command: 'newNote' }, { accelerator: 'Ctrl+T', command: 'newTodo' }, { accelerator: 'Ctrl+S', command: 'synchronize' }, - { accelerator: '', command: 'print' }, + { accelerator: null, command: 'print' }, { accelerator: 'Ctrl+Q', command: 'quit' }, { accelerator: 'Ctrl+Alt+I', command: 'insertTemplate' }, { accelerator: 'Ctrl+C', command: 'textCopy' },