mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-30 10:36:35 +02:00
Desktop: Regression: Keyboard shortcut would not save in some cases
This commit is contained in:
parent
9a6f6c8b39
commit
6a068a90b2
@ -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 (
|
||||
<div style={styles.warning}>
|
||||
<div style={{ ...styles.warning, position: 'absolute', top: 0 }}>
|
||||
<p style={styles.text}>
|
||||
<span>
|
||||
{error.message}
|
||||
|
@ -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';
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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' },
|
||||
|
Loading…
Reference in New Issue
Block a user