1
0
mirror of https://github.com/mifi/lossless-cut.git synced 2024-11-21 18:02:35 +01:00

add mousetrap type

This commit is contained in:
Mikael Finstad 2024-10-07 10:43:50 +02:00
parent 2f361b4dd6
commit f444a029f8
No known key found for this signature in database
GPG Key ID: 25AB36E3E81CBC26
4 changed files with 16 additions and 2 deletions

View File

@ -57,6 +57,7 @@
"@types/luxon": "^3.4.2",
"@types/mime-types": "^2.1.4",
"@types/morgan": "^1.9.9",
"@types/mousetrap": "^1.6.15",
"@types/node": "18",
"@types/react": "^18.2.66",
"@types/react-dom": "^18.2.22",

View File

@ -49,7 +49,10 @@ function fixKeys(keys: string[]) {
const CreateBinding = memo(({
actionsMap, action, setCreatingBinding, onNewKeyBindingConfirmed,
}: {
actionsMap: ActionsMap, action: KeyboardAction | undefined, setCreatingBinding: Dispatch<SetStateAction<KeyboardAction | undefined>>, onNewKeyBindingConfirmed: (a: KeyboardAction, keys: string[]) => void,
actionsMap: ActionsMap,
action: KeyboardAction | undefined,
setCreatingBinding: Dispatch<SetStateAction<KeyboardAction | undefined>>,
onNewKeyBindingConfirmed: (a: KeyboardAction, keys: string[]) => void,
}) => {
const { t } = useTranslation();

View File

@ -40,6 +40,8 @@ export default ({ keyBindings, onKeyPress: onKeyPressProp }: {
}
});
return () => mousetrap.reset();
return () => {
mousetrap.reset();
};
}, [keyBindings]);
};

View File

@ -2149,6 +2149,13 @@ __metadata:
languageName: node
linkType: hard
"@types/mousetrap@npm:^1.6.15":
version: 1.6.15
resolution: "@types/mousetrap@npm:1.6.15"
checksum: 10/58ec552218108f8e5f0d40ee81579aafbdb00c3af0ef4b6d3fb193a8a11a2d37aa84c6e20524120b7f218c2a87dac24f426ee3b23e1269d42f8145a1a37c9eca
languageName: node
linkType: hard
"@types/ms@npm:*":
version: 0.7.31
resolution: "@types/ms@npm:0.7.31"
@ -7610,6 +7617,7 @@ __metadata:
"@types/luxon": "npm:^3.4.2"
"@types/mime-types": "npm:^2.1.4"
"@types/morgan": "npm:^1.9.9"
"@types/mousetrap": "npm:^1.6.15"
"@types/node": "npm:18"
"@types/react": "npm:^18.2.66"
"@types/react-dom": "npm:^18.2.22"