mirror of https://github.com/keeweb/keeweb.git
eslint
This commit is contained in:
parent
40dd3637d7
commit
0ce5fc462a
|
@ -161,6 +161,7 @@
|
|||
"no-else-return": "off",
|
||||
"jest/valid-expect": "off",
|
||||
"jest/expect-expect": "off",
|
||||
"react-hooks/exhaustive-deps": "off",
|
||||
"@typescript-eslint/no-explicit-any": "error",
|
||||
"@typescript-eslint/no-unused-vars": "error",
|
||||
"@typescript-eslint/explicit-module-boundary-types": "error",
|
||||
|
|
|
@ -14,17 +14,6 @@ import { useModelWatcher } from 'util/ui/hooks';
|
|||
export const AppMenuItem: FunctionComponent<{ item: MenuItem }> = ({ item }) => {
|
||||
useModelWatcher(item);
|
||||
|
||||
useEffect(() => {
|
||||
if (item.shortcut) {
|
||||
const offs: Callback[] = [];
|
||||
offs.push(KeyHandler.onKey(item.shortcut, selectItem, KeyHandler.SHORTCUT_OPT));
|
||||
if (item.shortcut !== Keys.DOM_VK_C) {
|
||||
offs.push(KeyHandler.onKey(item.shortcut, selectItem, KeyHandler.SHORTCUT_ACTION));
|
||||
}
|
||||
return () => offs.forEach((off) => off());
|
||||
}
|
||||
}, []);
|
||||
|
||||
const selectItem = () => {
|
||||
if (item.active) {
|
||||
return;
|
||||
|
@ -38,6 +27,17 @@ export const AppMenuItem: FunctionComponent<{ item: MenuItem }> = ({ item }) =>
|
|||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (item.shortcut) {
|
||||
const offs: Callback[] = [];
|
||||
offs.push(KeyHandler.onKey(item.shortcut, selectItem, KeyHandler.SHORTCUT_OPT));
|
||||
if (item.shortcut !== Keys.DOM_VK_C) {
|
||||
offs.push(KeyHandler.onKey(item.shortcut, selectItem, KeyHandler.SHORTCUT_ACTION));
|
||||
}
|
||||
return () => offs.forEach((off) => off());
|
||||
}
|
||||
}, [item.shortcut]);
|
||||
|
||||
const itemClicked = () => {
|
||||
selectItem();
|
||||
};
|
||||
|
|
|
@ -5,7 +5,6 @@ import { SecureInput, SecureInputEvent } from 'views/components/secure-input';
|
|||
import { useLayoutEffect, useRef } from 'preact/hooks';
|
||||
import { useEvent } from 'util/ui/hooks';
|
||||
import { classes } from 'util/ui/classes';
|
||||
import { FocusDetector } from 'comp/browser/focus-detector';
|
||||
import { Features } from 'util/features';
|
||||
|
||||
export const OpenPasswordView: FunctionComponent<{
|
||||
|
|
Loading…
Reference in New Issue